]> granicus.if.org Git - apache/commitdiff
Add PROXY_WORKER_IGNORE_ERRORS flags that
authorMladen Turk <mturk@apache.org>
Thu, 9 Sep 2004 13:15:40 +0000 (13:15 +0000)
committerMladen Turk <mturk@apache.org>
Thu, 9 Sep 2004 13:15:40 +0000 (13:15 +0000)
disables puting the entire worker in retry mode, cause
for forward workers the remote is not fixed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105047 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

index 2fb560c71186917f4389d56f1c6cca0ceacb568c..ac9622390bb76c50b83247ceb8d6439d3c269e81 100644 (file)
@@ -1120,13 +1120,16 @@ static const char *
 
     psf->req = flag;
     psf->req_set = 1;
-    /* Add default forward proxy worker */
-    if ((err = ap_proxy_add_worker(&(psf->forward), parms->pool,
-                                   psf, "*://*:0"))) {
-        return apr_pstrcat(parms->temp_pool, "ProxyRequests ", err, NULL); 
-    }
-        
 
+    if (flag) {
+        /* Add default forward proxy worker */
+        if ((err = ap_proxy_add_worker(&(psf->forward), parms->pool,
+                                       psf, "*://*:0"))) {
+            return apr_pstrcat(parms->temp_pool, "ProxyRequests ", err, NULL); 
+        }
+        /* Do not disable worker in case of errors */
+        psf->forward->status = PROXY_WORKER_IGNORE_ERRORS;
+    }
     return NULL;
 }
 
index 147001e02ba0a70e1e626f3c460fbf17991853f3..690cf93e9857895546c84d831446f0e8a11b79f6 100644 (file)
@@ -224,6 +224,7 @@ struct proxy_conn_pool {
 
 /* woker status flags */
 #define PROXY_WORKER_INITIALIZED    0x0001
+#define PROXY_WORKER_IGNORE_ERRORS  0x0002
 #define PROXY_WORKER_IN_SHUTDOWN    0x0010
 #define PROXY_WORKER_DISABLED       0x0020
 #define PROXY_WORKER_IN_ERROR       0x0040
index 6da107b6c3a741b78a100ed80de042845a81eacc..ed7590b969592adf1d943d8f60b59190a3765e9c 100644 (file)
@@ -1812,11 +1812,13 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
         conn->sock   = newsock;
         connected    = 1;
     }
-    /* Put the entire worker to error state
+    /* Put the entire worker to error state if
+     * the PROXY_WORKER_IGNORE_ERRORS flag is not set.
      * Altrough some connections may be alive
      * no further connections to the worker could be made
      */
-    if (!connected && PROXY_WORKER_IS_USABLE(worker)) {
+    if (!connected && PROXY_WORKER_IS_USABLE(worker) &&
+        !(worker->status & PROXY_WORKER_IGNORE_ERRORS)) {
         worker->status |= PROXY_WORKER_IN_ERROR;
         worker->error_time = apr_time_now();
         ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,