You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2004/09/09 15:15:41 UTC
cvs commit: httpd-2.0/modules/proxy mod_proxy.c proxy_util.c mod_proxy.h
mturk 2004/09/09 06:15:40
Modified: modules/proxy mod_proxy.c proxy_util.c mod_proxy.h
Log:
Add PROXY_WORKER_IGNORE_ERRORS flags that
disables puting the entire worker in retry mode, cause
for forward workers the remote is not fixed.
Revision Changes Path
1.139 +9 -6 httpd-2.0/modules/proxy/mod_proxy.c
Index: mod_proxy.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- mod_proxy.c 9 Sep 2004 10:24:27 -0000 1.138
+++ mod_proxy.c 9 Sep 2004 13:15:40 -0000 1.139
@@ -1120,13 +1120,16 @@
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;
}
1.139 +4 -2 httpd-2.0/modules/proxy/proxy_util.c
Index: proxy_util.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- proxy_util.c 9 Sep 2004 13:03:06 -0000 1.138
+++ proxy_util.c 9 Sep 2004 13:15:40 -0000 1.139
@@ -1812,11 +1812,13 @@
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,
1.128 +1 -0 httpd-2.0/modules/proxy/mod_proxy.h
Index: mod_proxy.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.h,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -r1.127 -r1.128
--- mod_proxy.h 9 Sep 2004 13:03:06 -0000 1.127
+++ mod_proxy.h 9 Sep 2004 13:15:40 -0000 1.128
@@ -224,6 +224,7 @@
/* 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