Welcome! Log In Create A New Profile

Advanced

[nginx] Limit recursive subrequests instead of simultaneous.

Valentin Bartenev
August 23, 2015 02:26PM
details: http://hg.nginx.org/nginx/rev/06e850859a26
branches:
changeset: 6237:06e850859a26
user: Valentin Bartenev <vbart@nginx.com>
date: Sun Aug 23 21:03:32 2015 +0300
description:
Limit recursive subrequests instead of simultaneous.

diffstat:

src/http/ngx_http_core_module.c | 6 ++----
src/http/ngx_http_request.c | 1 -
2 files changed, 2 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r b48663791c17 -r 06e850859a26 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c Sun Aug 23 21:03:29 2015 +0300
+++ b/src/http/ngx_http_core_module.c Sun Aug 23 21:03:32 2015 +0300
@@ -2427,12 +2427,9 @@ ngx_http_subrequest(ngx_http_request_t *
ngx_http_core_srv_conf_t *cscf;
ngx_http_postponed_request_t *pr, *p;

- r->main->subrequests--;
-
- if (r->main->subrequests == 0) {
+ if (r->subrequests == 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"subrequests cycle while processing \"%V\"", uri);
- r->main->subrequests = 1;
return NGX_ERROR;
}

@@ -2537,6 +2534,7 @@ ngx_http_subrequest(ngx_http_request_t *
sr->main_filter_need_in_memory = r->main_filter_need_in_memory;

sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
+ sr->subrequests = r->subrequests - 1;

tp = ngx_timeofday();
sr->start_sec = tp->sec;
diff -r b48663791c17 -r 06e850859a26 src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c Sun Aug 23 21:03:29 2015 +0300
+++ b/src/http/ngx_http_request.c Sun Aug 23 21:03:32 2015 +0300
@@ -2338,7 +2338,6 @@ ngx_http_finalize_request(ngx_http_reque
if (r == c->data) {

r->main->count--;
- r->main->subrequests++;

if (!r->logged) {


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Limit recursive subrequests instead of simultaneous.

Valentin Bartenev 616 August 23, 2015 02:26PM



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

Online Users

Guests: 160
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