]> git.kaiwu.me - nginx.git/commitdiff
Added clearing of modules' contexts in ngx_http_named_location().
authorMaxim Dounin <mdounin@mdounin.ru>
Sat, 15 Oct 2011 21:42:03 +0000 (21:42 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Sat, 15 Oct 2011 21:42:03 +0000 (21:42 +0000)
Patch by Yichun Zhang (agentzh).

src/http/ngx_http_core_module.c

index b9437623689624978828ac8a12e776e8fae508b4..c6909cd2ee266167743a006b8522c96406117cdd 100644 (file)
@@ -2546,6 +2546,9 @@ ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
             r->content_handler = NULL;
             r->loc_conf = (*clcfp)->loc_conf;
 
+            /* clear the modules contexts */
+            ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
+
             ngx_http_update_location_config(r);
 
             cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);