diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-05-21 13:28:21 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-05-21 13:28:21 +0000 |
commit | fa73aac7747c9d0a8575eb2beffcdab50171e006 (patch) | |
tree | d1e354f2e321b8f1c4e5518984759bab1ae05ddd /src/http/ngx_http_event.c | |
parent | 1c13c662f0ae8066d1d4849b4158d7459a4c7822 (diff) | |
download | nginx-fa73aac7747c9d0a8575eb2beffcdab50171e006.tar.gz nginx-fa73aac7747c9d0a8575eb2beffcdab50171e006.zip |
nginx-0.0.1-2003-05-21-17:28:21 import
Diffstat (limited to 'src/http/ngx_http_event.c')
-rw-r--r-- | src/http/ngx_http_event.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c index f14dd96ff..83f0f688d 100644 --- a/src/http/ngx_http_event.c +++ b/src/http/ngx_http_event.c @@ -996,6 +996,7 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r) ngx_connection_t *c; ngx_http_log_ctx_t *ctx; ngx_http_core_main_conf_t *cmcf; + ngx_http_core_loc_conf_t *clcf; c = (ngx_connection_t *) r->connection; rev = c->read; @@ -1004,6 +1005,17 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r) ctx->action = "closing request"; ngx_http_close_request(r, 0); + if (rev->timer_set) { + ngx_del_timer(rev); + } else { + rev->timer_set = 1; + } + + clcf = (ngx_http_core_loc_conf_t *) + ngx_http_get_module_loc_conf(r, ngx_http_core_module_ctx); + + ngx_add_timer(rev, clcf->keepalive_timeout); + if (rev->blocked && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) { if (ngx_add_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT) == NGX_ERROR) { ngx_http_close_connection(c); |