Welcome! Log In Create A New Profile

Advanced

[nginx] Simplified subrequest finalization.

Roman Arutyunyan
March 02, 2020 12:56PM
details: https://hg.nginx.org/nginx/rev/1d207b77b44a
branches:
changeset: 7632:1d207b77b44a
user: Roman Arutyunyan <arut@nginx.com>
date: Fri Feb 28 19:54:13 2020 +0300
description:
Simplified subrequest finalization.

Now it looks similar to what it was before background subrequests were
introduced in 9552758a786e.

diffstat:

src/http/ngx_http_request.c | 36 ++++++++++++------------------------
1 files changed, 12 insertions(+), 24 deletions(-)

diffs (64 lines):

diff -r b4dbf8b98f9a -r 1d207b77b44a src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c Mon Mar 02 20:07:36 2020 +0300
+++ b/src/http/ngx_http_request.c Fri Feb 28 19:54:13 2020 +0300
@@ -2488,7 +2488,6 @@ 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->buffered || r->postponed) {

@@ -2499,8 +2498,14 @@ ngx_http_finalize_request(ngx_http_reque
return;
}

- if (r->background) {
+ 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);
}
@@ -2514,31 +2519,14 @@ ngx_http_finalize_request(ngx_http_reque
}

r->done = 1;
- ngx_http_finalize_connection(r);
- return;
- }
-
- pr = r->parent;
-
- if (r == c->data) {
+
+ if (r->background) {
+ ngx_http_finalize_connection(r);
+ return;
+ }

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;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Simplified subrequest finalization.

Roman Arutyunyan 298 March 02, 2020 12:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 143
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready