]> granicus.if.org Git - apache/commitdiff
Enable retry=0 for the worker.
authorMladen Turk <mturk@apache.org>
Sat, 30 Sep 2006 10:41:51 +0000 (10:41 +0000)
committerMladen Turk <mturk@apache.org>
Sat, 30 Sep 2006 10:41:51 +0000 (10:41 +0000)
This allows to have an option to always retry
the workers in error state instead using a
specified time.

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

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

index 5795d53324765fc5ecdffe18f711c97450b02561..a9d874929ead9c81a4c83c9a0970f09a8e1c0ef6 100644 (file)
@@ -85,9 +85,10 @@ static const char *set_worker_param(apr_pool_t *p,
          * in error state, it will be retried after that timeout.
          */
         ival = atoi(val);
-        if (ival < 1)
-            return "Retry must be at least one second";
+        if (ival < 0)
+            return "Retry must be a positive value";
         worker->retry = apr_time_from_sec(ival);
+        worker->retry_set = 1;
     }
     else if (!strcasecmp(key, "ttl")) {
         /* Time in seconds that will destroy all the connections
index 5da9b569c7bb5a0bf6c609bca43e809f8aded23f..b0f742c85253272155f3d3504b196b53ba8d8f24 100644 (file)
@@ -296,6 +296,7 @@ typedef struct {
 struct proxy_worker {
     int             id;         /* scoreboard id */
     apr_interval_time_t retry;  /* retry interval */
+    char            retry_set;
     int             lbfactor;   /* initial load balancing factor */
     const char      *name;
     const char      *scheme;    /* scheme to use ajp|http|https */
index f4b780d0cdae72cade6bd0e65883b46b89465978..fdf926f0801d5b316a7bb22276c545794c9bd670 100644 (file)
@@ -1780,7 +1780,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser
     }
 
     /* Set default parameters */
-    if (!worker->retry) {
+    if (!worker->retry_set) {
         worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
     }
     /* By default address is reusable */