Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 6237:06e850859a26
Limit recursive subrequests instead of simultaneous.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Sun, 23 Aug 2015 21:03:32 +0300 |
parents | bd55d75a1410 |
children | 8c6e71722aff |
comparison
equal
deleted
inserted
replaced
6236:b48663791c17 | 6237:06e850859a26 |
---|---|
2425 ngx_connection_t *c; | 2425 ngx_connection_t *c; |
2426 ngx_http_request_t *sr; | 2426 ngx_http_request_t *sr; |
2427 ngx_http_core_srv_conf_t *cscf; | 2427 ngx_http_core_srv_conf_t *cscf; |
2428 ngx_http_postponed_request_t *pr, *p; | 2428 ngx_http_postponed_request_t *pr, *p; |
2429 | 2429 |
2430 r->main->subrequests--; | 2430 if (r->subrequests == 0) { |
2431 | |
2432 if (r->main->subrequests == 0) { | |
2433 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | 2431 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
2434 "subrequests cycle while processing \"%V\"", uri); | 2432 "subrequests cycle while processing \"%V\"", uri); |
2435 r->main->subrequests = 1; | |
2436 return NGX_ERROR; | 2433 return NGX_ERROR; |
2437 } | 2434 } |
2438 | 2435 |
2439 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); | 2436 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); |
2440 if (sr == NULL) { | 2437 if (sr == NULL) { |
2535 sr->discard_body = r->discard_body; | 2532 sr->discard_body = r->discard_body; |
2536 sr->expect_tested = 1; | 2533 sr->expect_tested = 1; |
2537 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; | 2534 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; |
2538 | 2535 |
2539 sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1; | 2536 sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1; |
2537 sr->subrequests = r->subrequests - 1; | |
2540 | 2538 |
2541 tp = ngx_timeofday(); | 2539 tp = ngx_timeofday(); |
2542 sr->start_sec = tp->sec; | 2540 sr->start_sec = tp->sec; |
2543 sr->start_msec = tp->msec; | 2541 sr->start_msec = tp->msec; |
2544 | 2542 |