From a21e30b91900dbbde5ea7fbc5ed4b2ec59969de7 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 13 Apr 2004 05:27:03 +0000 Subject: [PATCH] nginx-0.0.3-2004-04-13-09:27:03 import --- src/event/modules/ngx_epoll_module.c | 10 +++++----- src/event/ngx_event_accept.c | 1 - src/http/modules/proxy/ngx_http_proxy_handler.c | 4 ++++ src/os/unix/ngx_linux_init.c | 7 ++++++- src/os/unix/ngx_solaris_init.c | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/event/modules/ngx_epoll_module.c b/src/event/modules/ngx_epoll_module.c index ab0c19260..f4e993676 100644 --- a/src/event/modules/ngx_epoll_module.c +++ b/src/event/modules/ngx_epoll_module.c @@ -434,10 +434,6 @@ int ngx_epoll_process_events(ngx_cycle_t *cycle) c->write->returned_instance = instance; } -#if (NGX_DEBUG) - log = c->log ? c->log : cycle->log; -#endif - if (c->read->instance != instance) { /* @@ -445,11 +441,15 @@ int ngx_epoll_process_events(ngx_cycle_t *cycle) * that was just closed in this iteration */ - ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "epoll: stale event " PTR_FMT, c); continue; } +#if (NGX_DEBUG) + log = c->log ? c->log : cycle->log; +#endif + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0, "epoll: fd:%d ev:%04X d:" PTR_FMT, c->fd, event_list[i].events, event_list[i].data); diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c index 235ff7fc7..07fc6a325 100644 --- a/src/event/ngx_event_accept.c +++ b/src/event/ngx_event_accept.c @@ -328,7 +328,6 @@ ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle) if (*ngx_accept_mutex == 0 && ngx_atomic_cmp_set(ngx_accept_mutex, 0, ngx_pid)) { - ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "accept mutex locked"); diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c index 84c926470..017d7c8d0 100644 --- a/src/http/modules/proxy/ngx_http_proxy_handler.c +++ b/src/http/modules/proxy/ngx_http_proxy_handler.c @@ -425,6 +425,10 @@ void ngx_http_proxy_check_broken_connection(ngx_event_t *ev) n = recv(c->fd, buf, 1, MSG_PEEK); + if (ev->write && n >= 0) { + return; + } + if (n > 0) { if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && ev->active) { if (ngx_del_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) { diff --git a/src/os/unix/ngx_linux_init.c b/src/os/unix/ngx_linux_init.c index 387a49143..ea2e812be 100644 --- a/src/os/unix/ngx_linux_init.c +++ b/src/os/unix/ngx_linux_init.c @@ -9,10 +9,15 @@ char ngx_linux_kern_osrelease[20]; ngx_os_io_t ngx_os_io = { ngx_unix_recv, + ngx_readv_chain, NULL, - NULL, +#if (HAVE_SENDFILE) ngx_linux_sendfile_chain, NGX_IO_SENDFILE +#else + ngx_writev_chain, + 0 +#endif }; diff --git a/src/os/unix/ngx_solaris_init.c b/src/os/unix/ngx_solaris_init.c index b2aba61b9..8f2e484b2 100644 --- a/src/os/unix/ngx_solaris_init.c +++ b/src/os/unix/ngx_solaris_init.c @@ -10,7 +10,7 @@ char ngx_solaris_version[50]; ngx_os_io_t ngx_os_io = { ngx_unix_recv, - NULL, + ngx_readv_chain, NULL, #if (HAVE_SENDFILE) ngx_solaris_sendfilev_chain,