comparison src/http/ngx_http_core_module.c @ 7427:81d49f85afed

Copy regex unnamed captures to cloned subrequests. Previously, unnamed regex captures matched in the parent request, were not available in a cloned subrequest. Now 3 fields related to unnamed captures are copied to a cloned subrequest: r->ncaptures, r->captures and r->captures_data. Since r->captures cannot be changed by either request after creating a clone, a new flag r->realloc_captures is introduced to force reallocation of r->captures. The issue was reported as a proxy_cache_background_update misbehavior in http://mailman.nginx.org/pipermail/nginx/2018-December/057251.html.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 11 Dec 2018 13:09:00 +0300
parents 89430899c72a
children 4f9b72a229c1
comparison
equal deleted inserted replaced
7426:4722b4b8aa93 7427:81d49f85afed
2383 sr->valid_location = r->valid_location; 2383 sr->valid_location = r->valid_location;
2384 sr->valid_unparsed_uri = r->valid_unparsed_uri; 2384 sr->valid_unparsed_uri = r->valid_unparsed_uri;
2385 sr->content_handler = r->content_handler; 2385 sr->content_handler = r->content_handler;
2386 sr->phase_handler = r->phase_handler; 2386 sr->phase_handler = r->phase_handler;
2387 sr->write_event_handler = ngx_http_core_run_phases; 2387 sr->write_event_handler = ngx_http_core_run_phases;
2388
2389 #if (NGX_PCRE)
2390 sr->ncaptures = r->ncaptures;
2391 sr->captures = r->captures;
2392 sr->captures_data = r->captures_data;
2393 sr->realloc_captures = 1;
2394 r->realloc_captures = 1;
2395 #endif
2388 2396
2389 ngx_http_update_location_config(sr); 2397 ngx_http_update_location_config(sr);
2390 } 2398 }
2391 2399
2392 return ngx_http_post_request(sr, NULL); 2400 return ngx_http_post_request(sr, NULL);