From: Ruediger Pluem Date: Mon, 15 Oct 2012 14:38:04 +0000 (+0000) Subject: * If we face a timeout during receiving the response from the backend and if X-Git-Tag: 2.5.0-alpha~6196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dd8e07528e30a48a0288c0b4ccb706eed3466fc;p=thirdparty%2Fapache%2Fhttpd.git * If we face a timeout during receiving the response from the backend and if we pinged it successfully before don't assume the whole backend has failed. Assume that only the request has failed and return a gateway timeout then. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398307 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 3736156afcd..e796f73b5e4 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -657,7 +657,16 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, */ rv = HTTP_SERVICE_UNAVAILABLE; } else { - rv = HTTP_INTERNAL_SERVER_ERROR; + /* If we had a successful cping/cpong and then a timeout + * we assume it is a request that cause a back-end timeout, + * but doesn't affect the whole worker. + */ + if (APR_STATUS_IS_TIMEUP(status) && conn->worker->s->ping_timeout_set) { + rv = HTTP_GATEWAY_TIME_OUT; + } + else { + rv = HTTP_INTERNAL_SERVER_ERROR; + } } }