From: Jim Jagielski Date: Thu, 19 Nov 2009 14:07:46 +0000 (+0000) Subject: Merge r806920 from trunk: X-Git-Tag: 2.2.15~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be2a86b3eb48a3d98499f3d509c8df26d4e25cd;p=thirdparty%2Fapache%2Fhttpd.git Merge r806920 from trunk: Return consistent error status for proxy unable to connect PR 46971 Submitted by: niq Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@882153 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e34a4070295..763b39d7d54 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,10 @@ Changes with Apache 2.2.15 control is still vulnerable, unless using OpenSSL >= 0.9.8l. [Joe Orton, Ruediger Pluem] + *) Proxy: unable to connect to a backend is SERVICE_UNAVAILABLE, + rather than BAD_GATEWAY or (especially) NOT_FOUND. + PR 46971 [evanc nortel.com] + *) mod_charset_lite: Honor 'CharsetOptions NoImplicitAdd'. [Eric Covener] diff --git a/STATUS b/STATUS index 15e66f5d52b..14f951a80b4 100644 --- a/STATUS +++ b/STATUS @@ -87,11 +87,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * proxy: return consistent error message in case of failure to - connect to backend. - PR 46971 - Patch: http://svn.apache.org/viewvc?rev=806920&view=rev - +1: niq, covener, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/modules/proxy/mod_proxy_connect.c b/modules/proxy/mod_proxy_connect.c index 8804359c090..d66a50d8193 100644 --- a/modules/proxy/mod_proxy_connect.c +++ b/modules/proxy/mod_proxy_connect.c @@ -201,7 +201,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, return DECLINED; } else { - return HTTP_BAD_GATEWAY; + return HTTP_SERVICE_UNAVAILABLE; } } diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 34015263040..b8fe37c8bc2 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1974,10 +1974,7 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker, /* Step Two: Make the Connection */ if (ap_proxy_connect_backend(proxy_function, backend, worker, r->server)) { - if (r->proxyreq == PROXYREQ_PROXY) - status = HTTP_NOT_FOUND; - else - status = HTTP_SERVICE_UNAVAILABLE; + status = HTTP_SERVICE_UNAVAILABLE; goto cleanup; }