httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwise...@fscinternet.com (Graham Wiseman)
Subject [patch] bug 17928 - mod_proxy hangs when backend server returns a 304
Date Tue, 08 Jul 2003 18:58:02 GMT
This bug occurs in mod_proxy when both KeepAlive and
ProxyErrorOverride are enabled, and non-200 response
without a body is generated by the backend server.
e.g.: a request containing the "If-Modified-Since" and
"If-None-Match" headers, which the backend server responds
to with status 304.

Conditions:
- mod_proxy acting as a forward or reverse proxy
- KeepAlive On
- ProxyErrorOverride On
- Persistent connection to backend server
- backend server responds with a non-200 status
- backend server does not send a body

Details:
In proxy_http.c, ap_discard_request_body() is called on a
request with a non-200 status when ProxyErrorOverride is
enabled. ap_discard_request_body() eventually calls
ap_http_filter() which, when called with a proxy response
request_rec, attempts to read a body even when there is no
indication that one exists (response bodies can be
terminated with a connection close, instead of using a CL
header or chunked encoding). However, on a persistent
connection to the backend, the read blocks until a timeout
occurs (apr_wait_for_io_or_timeout()).

The attached patch works around this problem by not calling
ap_discard_request_body() on responses that never have a
response body (1xx, 204, 205, 304).


Graham Wiseman
gwiseman@fscinternet.com


 

Mime
View raw message