diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-08-07 10:53:27 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-08-07 10:53:27 +0000 |
commit | 4fbd86829b6217cc3b074e833d89a8019e278e79 (patch) | |
tree | e8a85fd172ef2cc7ccb53a4451cce814118baa6c /src/http/ngx_http_request.c | |
parent | 5aca0e4678bef816cf02ca3a17bb93188eb3b6b4 (diff) | |
download | nginx-4fbd86829b6217cc3b074e833d89a8019e278e79.tar.gz nginx-4fbd86829b6217cc3b074e833d89a8019e278e79.zip |
discard request body before going to keep-alive state and use lingering timeouts
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 27fd15946..dd9ec2350 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1921,8 +1921,16 @@ ngx_http_set_keepalive(ngx_http_request_t *r) c = r->connection; rev = c->read; + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler"); + if (r->discard_body) { + r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); + ngx_add_timer(rev, clcf->lingering_timeout); + return; + } + c->log->action = "closing request"; hc = r->http_connection; @@ -1966,8 +1974,6 @@ ngx_http_set_keepalive(ngx_http_request_t *r) } } - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_http_request_done(r, 0); c->data = hc; |