From 79fb63443c51d0959bfbb969b71dc6cff546a549 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 9 Jan 2004 03:04:41 +0000 Subject: [PATCH] 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: Richard Reiner, Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102239 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ modules/proxy/proxy_http.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f168fea945..6e98e6e745 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) 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_ssl: Add support for distributed session cache using 'distcache'. [Geoff Thorpe ] diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 03a563bf27..0dbcd11de5 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -1091,7 +1091,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 -- 2.40.0