Mercurial > hg > nginx-vendor-0-8
diff src/event/modules/ngx_devpoll_module.c @ 2:cc9f381affaa NGINX_0_1_1
nginx 0.1.1
*) Feature: the gzip_types directive.
*) Feature: the tcp_nodelay directive.
*) Feature: the send_lowat directive is working not only on OSes that
support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT.
*) Feature: the setproctitle() emulation for Linux and Solaris.
*) Bugfix: the "Location" header rewrite bug fixed while the proxying.
*) Bugfix: the ngx_http_chunked_module module may get caught in an
endless loop.
*) Bugfix: the /dev/poll module bugs fixed.
*) Bugfix: the responses were corrupted when the temporary files were
used while the proxying.
*) Bugfix: the unescaped requests were passed to the backend.
*) Bugfix: while the build configuration on Linux 2.4 the
--with-poll_module parameter was required.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 11 Oct 2004 00:00:00 +0400 |
parents | f0b350454894 |
children | 46833bd150cb |
line wrap: on
line diff
--- a/src/event/modules/ngx_devpoll_module.c +++ b/src/event/modules/ngx_devpoll_module.c @@ -202,13 +202,7 @@ static int ngx_devpoll_add_event(ngx_eve #endif #if (NGX_READ_EVENT != POLLIN) - if (event == NGX_READ_EVENT) { - event = POLLOUT; -#if (NGX_WRITE_EVENT != POLLOUT) - } else { - event = POLLIN; -#endif - } + event = (event == NGX_READ_EVENT) ? POLLIN : POLLOUT; #endif #if (NGX_DEBUG) @@ -218,6 +212,7 @@ static int ngx_devpoll_add_event(ngx_eve #endif ev->active = 1; + return ngx_devpoll_set_event(ev, event, 0); } @@ -229,6 +224,10 @@ static int ngx_devpoll_del_event(ngx_eve c = ev->data; +#if (NGX_READ_EVENT != POLLIN) + event = (event == NGX_READ_EVENT) ? POLLIN : POLLOUT; +#endif + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0, "devpoll del event: fd:%d ev:%04X", c->fd, event); @@ -242,13 +241,9 @@ static int ngx_devpoll_del_event(ngx_eve return NGX_OK; } - /* we need to restore the second event if it exists */ + /* restore the paired event if it exists */ - if (event == NGX_READ_EVENT) { - if (ev->accept) { - return NGX_OK; - } - + if (event == POLLIN) { e = c->write; event = POLLOUT; @@ -257,7 +252,7 @@ static int ngx_devpoll_del_event(ngx_eve event = POLLIN; } - if (e) { + if (e && e->active) { return ngx_devpoll_set_event(e, event, 0); } @@ -273,7 +268,7 @@ static int ngx_devpoll_set_event(ngx_eve c = ev->data; ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, - "devpoll fd:%d ev:%d fl:%d", c->fd, event, flags); + "devpoll fd:%d ev:%04X fl:%04X", c->fd, event, flags); if (nchanges >= max_changes) { ngx_log_error(NGX_LOG_WARN, ev->log, 0,