]> granicus.if.org Git - apache/commitdiff
Add route and redirect to worker so they can be set trough configuration.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:56:51 +0000 (22:56 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:56:51 +0000 (22:56 +0000)
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
modules/proxy/proxy_util.c

index b4882ee5921886306f24ae478196db3d05d5829b..73bdec121df045c59e092ef2b50595977a7d735f 100644 (file)
@@ -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 {
index b509e0264b4a32b466e90b0fd1f33403d05d68db..f962512e776ce66a51cf64d7892f53390af8be77 100644 (file)
@@ -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) {