comparison src/event/ngx_event.h @ 509:9b8c906f6e63 release-0.1.29

nginx-0.1.29-RELEASE import *) Feature: the ngx_http_ssi_module supports "include virtual" command. *) Feature: the ngx_http_ssi_module supports the condition command like 'if expr="$NAME"' and "else" and "endif" commands. Only one nested level is supported. *) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and DATE_GMT variables and "config timefmt" command. *) Feature: the "ssi_ignore_recycled_buffers" directive. *) Bugfix: the "echo" command did not show the default value for the empty QUERY_STRING variable. *) Change: the ngx_http_proxy_module was rewritten. *) Feature: the "proxy_redirect", "proxy_pass_request_headers", "proxy_pass_request_body", and "proxy_method" directives. *) Feature: the "proxy_set_header" directive. The "proxy_x_var" was canceled and must be replaced with the proxy_set_header directive. *) Change: the "proxy_preserve_host" is canceled and must be replaced with the "proxy_set_header Host $host" and the "proxy_redirect off" directives, the "proxy_set_header Host $host:$proxy_port" directive and the appropriate proxy_redirect directives. *) Change: the "proxy_set_x_real_ip" is canceled and must be replaced with the "proxy_set_header X-Real-IP $remote_addr" directive. *) Change: the "proxy_add_x_forwarded_for" is canceled and must be replaced with the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for" directive. *) Change: the "proxy_set_x_url" is canceled and must be replaced with the "proxy_set_header X-URL http://$host:$server_port$request_uri" directive. *) Feature: the "fastcgi_param" directive. *) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params" directive are canceled and must be replaced with the fastcgi_param directives. *) Feature: the "index" directive can use the variables. *) Feature: the "index" directive can be used at http and server levels. *) Change: the last index only in the "index" directive can be absolute. *) Feature: the "rewrite" directive can use the variables. *) Feature: the "internal" directive. *) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR, SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME, REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables. *) Change: nginx now passes the invalid lines in a client request headers or a backend response header. *) Bugfix: if the backend did not transfer response for a long time and the "send_timeout" was less than "proxy_read_timeout", then nginx returned the 408 response. *) Bugfix: the segmentation fault was occurred if the backend sent an invalid line in response header; the bug had appeared in 0.1.26. *) Bugfix: the segmentation fault may occurred in FastCGI fault tolerance configuration. *) Bugfix: the "expires" directive did not remove the previous "Expires" and "Cache-Control" headers. *) Bugfix: nginx did not take into account trailing dot in "Host" header line. *) Bugfix: the ngx_http_auth_module did not work under Linux. *) Bugfix: the rewrite directive worked incorrectly, if the arguments were in a request. *) Bugfix: nginx could not be built on MacOS X.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 12 May 2005 14:58:06 +0000
parents fc9909c369b2
children 511a89da35ad
comparison
equal deleted inserted replaced
508:ca1020ce99ba 509:9b8c906f6e63
111 int available; 111 int available;
112 #else 112 #else
113 unsigned available:1; 113 unsigned available:1;
114 #endif 114 #endif
115 115
116 /* TODO rename to handler */ 116 ngx_event_handler_pt handler;
117 ngx_event_handler_pt event_handler;
118 117
119 118
120 #if (NGX_HAVE_AIO) 119 #if (NGX_HAVE_AIO)
121 120
122 #if (NGX_HAVE_IOCP) 121 #if (NGX_HAVE_IOCP)
472 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle); 471 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle);
473 ngx_int_t ngx_disable_accept_events(ngx_cycle_t *cycle); 472 ngx_int_t ngx_disable_accept_events(ngx_cycle_t *cycle);
474 ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle); 473 ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle);
475 474
476 475
476 ngx_int_t ngx_handle_read_event(ngx_event_t *rev, u_int flags);
477 ngx_int_t ngx_handle_write_event(ngx_event_t *wev, size_t lowat);
478
479
477 #if (NGX_WIN32) 480 #if (NGX_WIN32)
478 void ngx_event_acceptex(ngx_event_t *ev); 481 void ngx_event_acceptex(ngx_event_t *ev);
479 int ngx_event_post_acceptex(ngx_listening_t *ls, int n); 482 int ngx_event_post_acceptex(ngx_listening_t *ls, int n);
480 #endif 483 #endif
481 484
494 #if (NGX_WIN32) 497 #if (NGX_WIN32)
495 #include <ngx_iocp_module.h> 498 #include <ngx_iocp_module.h>
496 #endif 499 #endif
497 500
498 501
499
500 static ngx_inline ngx_int_t ngx_handle_read_event(ngx_event_t *rev, u_int flags)
501 {
502 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
503
504 /* kqueue, epoll */
505
506 if (!rev->active && !rev->ready) {
507 if (ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT)
508 == NGX_ERROR) {
509 return NGX_ERROR;
510 }
511 }
512
513 return NGX_OK;
514
515 } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
516
517 /* select, poll, /dev/poll */
518
519 if (!rev->active && !rev->ready) {
520 if (ngx_add_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT)
521 == NGX_ERROR)
522 {
523 return NGX_ERROR;
524 }
525
526 return NGX_OK;
527 }
528
529 if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {
530 if (ngx_del_event(rev, NGX_READ_EVENT, flags) == NGX_ERROR) {
531 return NGX_ERROR;
532 }
533
534 return NGX_OK;
535 }
536 }
537
538 /* aio, iocp, rtsig */
539
540 return NGX_OK;
541 }
542
543
544 static ngx_inline ngx_int_t ngx_handle_level_read_event(ngx_event_t *rev)
545 {
546 if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
547 if (!rev->active && !rev->ready) {
548 if (ngx_add_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT)
549 == NGX_ERROR)
550 {
551 return NGX_ERROR;
552 }
553
554 return NGX_OK;
555 }
556
557 if (rev->active && rev->ready) {
558 if (ngx_del_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
559 return NGX_ERROR;
560 }
561
562 return NGX_OK;
563 }
564 }
565
566 return NGX_OK;
567 }
568
569
570 static ngx_inline ngx_int_t ngx_handle_write_event(ngx_event_t *wev,
571 size_t lowat)
572 {
573 ngx_connection_t *c;
574
575 if (lowat) {
576 c = (ngx_connection_t *) wev->data;
577
578 if (ngx_send_lowat(c, lowat) == NGX_ERROR) {
579 return NGX_ERROR;
580 }
581 }
582
583 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
584
585 /* kqueue, epoll */
586
587 if (!wev->active && !wev->ready) {
588 if (ngx_add_event(wev, NGX_WRITE_EVENT,
589 NGX_CLEAR_EVENT | (lowat ? NGX_LOWAT_EVENT : 0))
590 == NGX_ERROR)
591 {
592 return NGX_ERROR;
593 }
594 }
595
596 return NGX_OK;
597
598 } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
599
600 /* select, poll, /dev/poll */
601
602 if (!wev->active && !wev->ready) {
603 if (ngx_add_event(wev, NGX_WRITE_EVENT, NGX_LEVEL_EVENT)
604 == NGX_ERROR)
605 {
606 return NGX_ERROR;
607 }
608
609 return NGX_OK;
610 }
611
612 if (wev->active && wev->ready) {
613 if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
614 return NGX_ERROR;
615 }
616
617 return NGX_OK;
618 }
619 }
620
621 /* aio, iocp, rtsig */
622
623 return NGX_OK;
624 }
625
626
627 static ngx_inline ngx_int_t ngx_handle_level_write_event(ngx_event_t *wev)
628 {
629 if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
630 if (!wev->active && !wev->ready) {
631 if (ngx_add_event(wev, NGX_WRITE_EVENT, NGX_LEVEL_EVENT)
632 == NGX_ERROR)
633 {
634 return NGX_ERROR;
635 }
636
637 return NGX_OK;
638 }
639
640 if (wev->active && wev->ready) {
641 if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
642 return NGX_ERROR;
643 }
644
645 return NGX_OK;
646 }
647 }
648
649 return NGX_OK;
650 }
651
652
653 #endif /* _NGX_EVENT_H_INCLUDED_ */ 502 #endif /* _NGX_EVENT_H_INCLUDED_ */