]> git.kaiwu.me - nginx.git/commitdiff
Added write event handler reset in ngx_http_named_location().
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 4 May 2012 11:35:22 +0000 (11:35 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 4 May 2012 11:35:22 +0000 (11:35 +0000)
On internal redirects this happens via ngx_http_handler() call, which is
not called on named location redirect.  As a result incorrect write handler
remained (if previously set) and this might cause incorrect behaviour (likely
request hang).

Patch by Yichun Zhang (agentzh).

src/http/ngx_http_core_module.c

index 42dd6644e9085cfcdf10b568693568d5dc670ece..29b918eaab9f5e27c2a933eb15825bedc1461916 100644 (file)
@@ -2599,6 +2599,7 @@ ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
 
             r->phase_handler = cmcf->phase_engine.location_rewrite_index;
 
+            r->write_event_handler = ngx_http_core_run_phases;
             ngx_http_core_run_phases(r);
 
             return NGX_DONE;