Hello!
I've just noticed that the "412 Precondition Failed page" for the
If-Unmodified-Since request header could lead to connection hang. That
is, when the 412 page cannot be sent out in a single run (seen EAGAIN
for example), then ngx_http_finalize_request will never close the
downstream connection due to the r->filter_finalize set by
ngx_http_filter_finalize_request.
This issue can be reproduced with the standard ngx_http_static_module
serving the sample index.html page.
Here attaches the patch for both nginx 1.0.15 to fix this (it should
also be applied to nginx 1.2.0, I think).
Comments welcome!
Thanks!
-agentzh
--- nginx-1.0.15/src/http/ngx_http_request.c 2012-03-05 20:49:32.000000000 +0800
+++ nginx-1.0.15-patched/src/http/ngx_http_request.c 2012-05-11
20:50:01.478111234 +0800
@@ -1900,6 +1900,7 @@
if (rc == NGX_OK && r->filter_finalize) {
c->error = 1;
+ ngx_http_finalize_connection(r);
return;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel