From b8a176667f642e68616e68a63291406a836fc79e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Aug 2004 22:56:51 +0000 Subject: [PATCH] Add route and redirect to worker so they can be set trough configuration. Add worker status flag definitions. Submitted by: mturk git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104611 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy.h | 13 +++++++++++-- modules/proxy/proxy_util.c | 5 ++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index b4882ee592..73bdec121d 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -213,6 +213,15 @@ struct proxy_conn_pool { proxy_conn_rec *conn; /* Single connection for prefork mpm's */ }; +/* woker status flags */ +#define PROXY_WORKER_INITIALIZED 0x0001 +#define PROXY_WORKER_IN_SHUTDOWN 0x0010 +#define PROXY_WORKER_DISABLED 0x0020 +#define PROXY_WORKER_IN_ERROR 0x0040 + +#define PROXY_WORKER_IS_USABLE(f) (!((f)->status & 0x00F0)) + + /* Worker configuration */ struct proxy_worker { int status; @@ -223,6 +232,8 @@ struct proxy_worker { const char *name; const char *scheme; /* scheme to use ajp|http|https */ const char *hostname; /* remote backend address */ + const char *route; /* balancing route */ + const char *redirect; /* temporary balancing redirection route */ apr_port_t port; int min; /* Desired minimum number of available connections */ int smax; /* Soft maximum on the total number of connections */ @@ -251,8 +262,6 @@ typedef struct { double lbstatus; /* Current lbstatus */ apr_size_t transfered; /* Number of bytes transfered to remote */ apr_size_t readed; /* Number of bytes readed from remote */ - const char *route; - const char *redirect; } proxy_runtime_worker; struct proxy_balancer { diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index b509e0264b..f962512e77 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1450,15 +1450,14 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, { apr_status_t rv; - if (!worker->status) { + if (!(worker->status & PROXY_WORKER_INITIALIZED)) { if ((rv = init_conn_worker(worker, s)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, "proxy: %s: failed to initialize worker for (%s)", proxy_function, worker->hostname); return DECLINED; } - /* TODO: make worker status codes */ - worker->status = 1; + worker->status = PROXY_WORKER_INITIALIZED; } #if APR_HAS_THREADS if (worker->hmax) { -- 2.50.1