Mercurial > hg > nginx
diff src/http/ngx_http_request.c @ 8330:5b7ec588de48 quic
Merged with the default branch.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 14 Apr 2020 19:35:20 +0300 |
parents | 5649079a41f4 1d207b77b44a |
children | 44cac24aaa44 |
line wrap: on
line diff
--- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2630,10 +2630,24 @@ ngx_http_finalize_request(ngx_http_reque } if (r != r->main) { - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - if (r->background) { + + if (r->buffered || r->postponed) { + + if (ngx_http_set_write_handler(r) != NGX_OK) { + ngx_http_terminate_request(r, 0); + } + + return; + } + + pr = r->parent; + + if (r == c->data || r->background) { + if (!r->logged) { + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + if (clcf->log_subrequest) { ngx_http_log_request(r); } @@ -2647,40 +2661,14 @@ ngx_http_finalize_request(ngx_http_reque } r->done = 1; - ngx_http_finalize_connection(r); - return; - } - - if (r->buffered || r->postponed) { - - if (ngx_http_set_write_handler(r) != NGX_OK) { - ngx_http_terminate_request(r, 0); + + if (r->background) { + ngx_http_finalize_connection(r); + return; } - return; - } - - pr = r->parent; - - if (r == c->data) { - r->main->count--; - if (!r->logged) { - if (clcf->log_subrequest) { - ngx_http_log_request(r); - } - - r->logged = 1; - - } else { - ngx_log_error(NGX_LOG_ALERT, c->log, 0, - "subrequest: \"%V?%V\" logged again", - &r->uri, &r->args); - } - - r->done = 1; - if (pr->postponed && pr->postponed->request == r) { pr->postponed = pr->postponed->next; }