From 6a68c112dceae26d7a9faddc7837705af736ee81 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 30 Sep 2006 10:41:51 +0000 Subject: [PATCH] Enable retry=0 for the worker. 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 | 5 +++-- modules/proxy/mod_proxy.h | 1 + modules/proxy/proxy_util.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 5795d53324..a9d874929e 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -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 diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index 5da9b569c7..b0f742c852 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -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 */ diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index f4b780d0cd..fdf926f080 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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 */ -- 2.40.0