Fixed possible request hang with filter finalization.

With r->filter_finalize set the ngx_http_finalize_connection() wasn't
called from ngx_http_finalize_request() called with NGX_OK, resulting in
r->main->count not being decremented, thus causing request hang in some
rare situations.

See here for more details:
http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002190.html

Patch by Yichun Zhang (agentzh).
This commit is contained in:
Maxim Dounin 2012-05-14 09:48:05 +00:00
parent 3aa1296653
commit bc191a2699

View file

@ -1933,6 +1933,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
if (rc == NGX_OK && r->filter_finalize) {
c->error = 1;
ngx_http_finalize_connection(r);
return;
}