aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2020-04-14 19:35:20 +0300
committerSergey Kandaurov <pluknet@nginx.com>2020-04-14 19:35:20 +0300
commit987a1216e7a9cdbff02c0ac43b0ebbf50476ba26 (patch)
treec5f29769ff038fa068fbfb6a9a2717019ce0fc3d /src/http/ngx_http_request.c
parentb77fd3dc58b8398bf85d7c11901f5497f1abdf9e (diff)
parent3ba88365b5acef17f01671cd969c909dee5e2cde (diff)
downloadnginx-987a1216e7a9cdbff02c0ac43b0ebbf50476ba26.tar.gz
nginx-987a1216e7a9cdbff02c0ac43b0ebbf50476ba26.zip
Merged with the default branch.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 4368e79c0..082938e00 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2630,26 +2630,6 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
}
if (r != r->main) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->background) {
- 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;
- ngx_http_finalize_connection(r);
- return;
- }
if (r->buffered || r->postponed) {
@@ -2662,11 +2642,12 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
pr = r->parent;
- if (r == c->data) {
-
- r->main->count--;
+ 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);
}
@@ -2681,6 +2662,13 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
r->done = 1;
+ if (r->background) {
+ ngx_http_finalize_connection(r);
+ return;
+ }
+
+ r->main->count--;
+
if (pr->postponed && pr->postponed->request == r) {
pr->postponed = pr->postponed->next;
}