Blame SOURCES/httpd-2.4.6-r1348019.patch

008793
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
008793
index 2121892..6f904b2 100644
008793
--- a/modules/proxy/proxy_util.c
008793
+++ b/modules/proxy/proxy_util.c
008793
@@ -2838,33 +2838,48 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
008793
 
008793
         connected    = 1;
008793
     }
008793
-    /*
008793
-     * Put the entire worker to error state if
008793
-     * the PROXY_WORKER_IGNORE_ERRORS flag is not set.
008793
-     * Altrough some connections may be alive
008793
-     * no further connections to the worker could be made
008793
-     */
008793
-    if (!connected && PROXY_WORKER_IS_USABLE(worker) &&
008793
-        !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) {
008793
-        worker->s->error_time = apr_time_now();
008793
-        worker->s->status |= PROXY_WORKER_IN_ERROR;
008793
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00959)
008793
-            "ap_proxy_connect_backend disabling worker for (%s) for %"
008793
-            APR_TIME_T_FMT "s",
008793
-            worker->s->hostname, apr_time_sec(worker->s->retry));
008793
+
008793
+    if (PROXY_WORKER_IS_USABLE(worker)) {
008793
+        /*
008793
+         * Put the entire worker to error state if
008793
+         * the PROXY_WORKER_IGNORE_ERRORS flag is not set.
008793
+         * Although some connections may be alive
008793
+         * no further connections to the worker could be made
008793
+         */
008793
+        if (!connected) {
008793
+            if (!(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) {
008793
+                worker->s->error_time = apr_time_now();
008793
+                worker->s->status |= PROXY_WORKER_IN_ERROR;
008793
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00959)
008793
+                    "ap_proxy_connect_backend disabling worker for (%s) for %"
008793
+                    APR_TIME_T_FMT "s",
008793
+                    worker->s->hostname, apr_time_sec(worker->s->retry));
008793
+            }
008793
+        }
008793
+        else {
008793
+            if (worker->s->retries) {
008793
+                /*
008793
+                 * A worker came back. So here is where we need to
008793
+                 * either reset all params to initial conditions or
008793
+                 * apply some sort of aging
008793
+                 */
008793
+            }
008793
+            worker->s->error_time = 0;
008793
+            worker->s->retries = 0;
008793
+        }
008793
+        return connected ? OK : DECLINED;
008793
     }
008793
     else {
008793
-        if (worker->s->retries) {
008793
-            /*
008793
-             * A worker came back. So here is where we need to
008793
-             * either reset all params to initial conditions or
008793
-             * apply some sort of aging
008793
-             */
008793
-        }
008793
-        worker->s->error_time = 0;
008793
-        worker->s->retries = 0;
008793
+        /*
008793
+         * The worker is in error likely done by a different thread / process
008793
+         * e.g. for a timeout or bad status. We should respect this and should
008793
+         * not continue with a connection via this worker even if we got one.
008793
+         */
008793
+         if (connected) {
008793
+             socket_cleanup(conn);
008793
+         }
008793
+         return DECLINED;
008793
     }
008793
-    return connected ? OK : DECLINED;
008793
 }
008793
 
008793
 PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,