diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-01-25 12:27:35 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-01-25 12:27:35 +0000 |
commit | e5a222c6fef26b51d956c35530178837c60bf8c4 (patch) | |
tree | 65dafe2f85fe2b09b82d3efd2abe2b43720a1f4e /src/event/modules/ngx_devpoll_module.c | |
parent | 4f06a9709164123e7d8ccbd6fa723da387a9a86c (diff) | |
download | nginx-release-0.1.16.tar.gz nginx-release-0.1.16.zip |
nginx-0.1.16-RELEASE importrelease-0.1.16
*) Bugfix: if the response were transferred by chunks, then on the HEAD
request the final chunk was issued.
*) Bugfix: the "Connection: keep-alive" header were issued, even if the
keepalive_timeout directive forbade the keep-alive use.
*) Bugfix: the errors in the ngx_http_fastcgi_module caused the
segmentation faults.
*) Bugfix: the compressed response encrypted by SSL may not transferred
complete.
*) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK
options, are not used for the unix domain sockets.
*) Feature: the rewrite directive supports the arguments rewriting.
*) Bugfix: the response code 400 was returned for the POST request with
the "Content-Length: 0" header; the bug had appeared in 0.1.14.
Diffstat (limited to 'src/event/modules/ngx_devpoll_module.c')
-rw-r--r-- | src/event/modules/ngx_devpoll_module.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/event/modules/ngx_devpoll_module.c b/src/event/modules/ngx_devpoll_module.c index 34775f2b1..aa61df7de 100644 --- a/src/event/modules/ngx_devpoll_module.c +++ b/src/event/modules/ngx_devpoll_module.c @@ -310,7 +310,7 @@ static int ngx_devpoll_set_event(ngx_event_t *ev, int event, u_int flags) int ngx_devpoll_process_events(ngx_cycle_t *cycle) { - int events; + int events, revents; ngx_int_t i; ngx_uint_t j, lock, accept_lock, expire; size_t n; @@ -463,30 +463,40 @@ int ngx_devpoll_process_events(ngx_cycle_t *cycle) } #endif + revents = event_list[i].revents; + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "devpoll: fd:%d, ev:%04Xd, rev:%04Xd", - event_list[i].fd, - event_list[i].events, event_list[i].revents); + event_list[i].fd, event_list[i].events, revents); - if (event_list[i].revents & (POLLERR|POLLHUP|POLLNVAL)) { + if (revents & (POLLERR|POLLHUP|POLLNVAL)) { ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "ioctl(DP_POLL) error fd:%d ev:%04Xd rev:%04Xd", - event_list[i].fd, - event_list[i].events, event_list[i].revents); + event_list[i].fd, event_list[i].events, revents); } - if (event_list[i].revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) - { + if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) { ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "strange ioctl(DP_POLL) events " "fd:%d ev:%04Xd rev:%04Xd", - event_list[i].fd, - event_list[i].events, event_list[i].revents); + event_list[i].fd, event_list[i].events, revents); + } + + if ((revents & (POLLERR|POLLHUP|POLLNVAL)) + && (revents & (POLLIN|POLLOUT)) == 0) + { + /* + * if the error events were returned without POLLIN or POLLOUT, + * then add these flags to handle the events at least in one + * active handler + */ + + revents |= POLLIN|POLLOUT; } wev = c->write; - if ((event_list[i].events & (POLLOUT|POLLERR|POLLHUP)) && wev->active) { + if ((revents & POLLOUT) && wev->active) { wev->ready = 1; if (!ngx_threaded && !ngx_accept_mutex_held) { @@ -505,7 +515,7 @@ int ngx_devpoll_process_events(ngx_cycle_t *cycle) rev = c->read; - if ((event_list[i].events & (POLLIN|POLLERR|POLLHUP)) && rev->active) { + if ((revents & POLLIN) && rev->active) { rev->ready = 1; if (!ngx_threaded && !ngx_accept_mutex_held) { |