From: Jim Jagielski Date: Tue, 18 Sep 2007 13:32:28 +0000 (+0000) Subject: Merge r451575, r451582 from trunk: X-Git-Tag: 2.2.7~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=831e1662ff9f18a13fd29b56acca9a1303d68006;p=thirdparty%2Fapache%2Fhttpd.git Merge r451575, r451582 from trunk: 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. Move new struct member to the end of the struct, so we can keep the compatibility. Submitted by: mturk Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@576910 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index e3f0610a5b3..c354877d316 100644 --- a/STATUS +++ b/STATUS @@ -79,16 +79,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_proxy: Enable retry=0 for the worker. - Trunk version of patch: - http://svn.apache.org/viewvc?view=rev&revision=451575 - http://svn.apache.org/viewvc?view=rev&revision=451582 - Backport version for 2.2.x of patch: - Trunk version of patch works but requires - http://people.apache.org/~jim/patches/retry_set-mmn.patch - in addition for MMN bump. - +1: jim, niq, rpluem - * mod_proxy_ajp: Differentiate within AJP between GET and HEAD requests. PR 43060 Trunk version of patch: diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 95871f1b4b3..c9d0be2ca08 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -114,6 +114,7 @@ * 20051115.4 (2.2.4) Added ap_get_server_banner() and * ap_get_server_description() (minor) * 20051115.5 (2.2.5) Added ap_mpm_safe_kill() (minor) + * 20051115.6 (2.2.7) Added retry_set to proxy_worker (minor) * */ @@ -122,7 +123,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20051115 #endif -#define MODULE_MAGIC_NUMBER_MINOR 5 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 0749a7eb729..d55ff24400f 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 8e2c5066c22..f2c89747887 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -330,6 +330,7 @@ struct proxy_worker { int lbset; /* load balancer cluster set */ apr_interval_time_t ping_timeout; char ping_timeout_set; + char retry_set; }; /* diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 05ec5da56db..8141d1b7800 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1722,7 +1722,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 */