From: Paul J. Reder Date: Fri, 30 Jan 2004 15:52:09 +0000 (+0000) Subject: * proxy_http fix: mod_proxy hangs when both KeepAlive and X-Git-Tag: 2.0.49~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3714864dd49226fef3adc1f34e62d463a394e3;p=thirdparty%2Fapache%2Fhttpd.git * proxy_http fix: mod_proxy hangs when both KeepAlive and ProxyErrorOverride are enabled, and a non-200 response without a body is generated by the backend server. Submitted by: Graham Wiseman , Richard Reiner Reviewed by: stoddard, nd, jerenkrantz, rederpj git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102465 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b172674ed24..012d44e2662 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with Apache 2.0.49 + *) proxy_http fix: mod_proxy hangs when both KeepAlive and + ProxyErrorOverride are enabled, and a non-200 response without a + body is generated by the backend server. (e.g.: a client makes a + request containing the "If-Modified-Since" and "If-None-Match" + headers, to which the backend server respond with status 304.) + [Graham Wiseman , Richard Reiner] + *) mod_dav: Reject requests which include an unescaped fragment in the Request-URI. PR 21779. [Amit Athavale ] diff --git a/STATUS b/STATUS index a3d7d848803..88bbf62f6c9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/01/30 13:26:23 $] +Last modified at [$Date: 2004/01/30 15:52:07 $] Release: @@ -86,12 +86,6 @@ PATCHES TO BACKPORT FROM 2.1 jerenkrantz: Why is rm not application/vnd.rn-realmedia as in PR 26079? +1: nd, trawick - * proxy_http fix: mod_proxy hangs when both KeepAlive and - ProxyErrorOverride are enabled, and a non-200 response without a - body is generated by the backend server. - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/proxy/proxy_http.c?r1=1.176&r2=1.177 - +1: stoddard, nd, jerenkrantz - * If large file support is enabled, allow any file that is greater than AP_MAX_SENDFILE to be split into multiple buckets. This allows Apache to send files that are greater than 2gig. Otherwise we run into diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 7256d99c5f2..228569581e0 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -995,7 +995,13 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, */ int status = r->status; r->status = HTTP_OK; - ap_discard_request_body(rp); + /* Discard body, if one is expected */ + if ((status > 199) && /* not any 1xx response */ + (status != HTTP_NO_CONTENT) && /* not 204 */ + (status != HTTP_RESET_CONTENT) && /* not 205 */ + (status != HTTP_NOT_MODIFIED)) { /* not 304 */ + ap_discard_request_body(rp); + } return status; } } else