From: Jeff Trawick Date: Fri, 20 Aug 2010 00:54:34 +0000 (+0000) Subject: mod_proxy: Rename erroronstatus to failonstatus... X-Git-Tag: 2.3.8~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a222cf2cfbe38a2728081180c95525a3eedef26;p=apache mod_proxy: Rename erroronstatus to failonstatus... ... by popular demand, and add documentation. Submitted by: Daniel Ruggeri git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987359 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c2355331a1..9060ecf57b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache 2.3.8 + *) mod_proxy: Rename erroronstatus to failonstatus. + [Daniel Ruggeri ] Changes with Apache 2.3.7 diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml index abdb2ce667..a7706dd416 100644 --- a/docs/manual/mod/mod_proxy.xml +++ b/docs/manual/mod/mod_proxy.xml @@ -864,6 +864,12 @@ expressions Balancer timeout in seconds. If set this will be the maximum time to wait for a free worker. Default is not to wait. + failonstatus + - + A single or comma-separated list of HTTP status codes. If set this will + force the worker into error state when the backend returns any status code + in the list. Worker recovery behaves the same as other worker errors. +

A sample balancer setup

diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index f4ba275abd..16ec4f931c 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -381,7 +381,7 @@ static const char *set_balancer_param(proxy_server_conf *conf, else return "scolonpathdelim must be On|Off"; } - else if (!strcasecmp(key, "erroronstatus")) { + else if (!strcasecmp(key, "failonstatus")) { char *val_split; char *status; char *tok_state; @@ -397,7 +397,7 @@ static const char *set_balancer_param(proxy_server_conf *conf, *(int *)apr_array_push(balancer->errstatuses) = ival; } else { - return "erroronstatus must be one or more HTTP response code"; + return "failonstatus must be one or more HTTP response codes"; } status = apr_strtok(NULL, ", ", &tok_state); } diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 1a53053ed4..107dc47865 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -628,7 +628,7 @@ static int proxy_balancer_post_request(proxy_worker *worker, int val = ((int *)balancer->errstatuses->elts)[i]; if (r->status == val) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, - "proxy: BALANCER: (%s). Forcing recovery for worker (%s), erroronstatus %d", + "proxy: BALANCER: (%s). Forcing recovery for worker (%s), failonstatus %d", balancer->name, worker->name, val); worker->s->status |= PROXY_WORKER_IN_ERROR; worker->s->error_time = apr_time_now();