Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-11-20 16:31:07 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-11-20 16:31:07 +0300
commitb32cb6b61079d2eff69c89e0e718a79258507717 (patch)
treee69f3694cce99d0315830aad61cf66e242c0afed /src/http/ngx_http_request.c
parentf1c4853ea1a981073b067cd1356febd08b86f898 (diff)
Fixed worker_shutdown_timeout in various cases.
The ngx_http_upstream_process_upgraded() did not handle c->close request, and upgraded connections do not use the write filter. As a result, worker_shutdown_timeout did not affect upgraded connections (ticket #1419). Fix is to handle c->close in the ngx_http_request_handler() function, thus covering most of the possible cases in http handling. Additionally, mail proxying did not handle neither c->close nor c->error, and thus worker_shutdown_timeout did not work for mail connections. Fix is to add c->close handling to ngx_mail_proxy_handler(). Also, added explicit handling of c->close to stream proxy, ngx_stream_proxy_process_connection(). This improves worker_shutdown_timeout handling in stream, it will no longer wait for some data being transferred in a connection before closing it, and will also provide appropriate logging at the "info" level.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index de1b20270..5668bf441 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2225,6 +2225,13 @@ ngx_http_request_handler(ngx_event_t *ev)
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http run request: \"%V?%V\"", &r->uri, &r->args);
+ if (c->close) {
+ r->main->count++;
+ ngx_http_terminate_request(r, 0);
+ ngx_http_run_posted_requests(c);
+ return;
+ }
+
if (ev->delayed && ev->timedout) {
ev->delayed = 0;
ev->timedout = 0;