]> granicus.if.org Git - apache/commitdiff
Set initial lbstatus to calculated lbfactor.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:55:28 +0000 (22:55 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:55:28 +0000 (22:55 +0000)
Submitted by: mturk

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104610 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_util.c

index aedff9f3655aa583553d026a47ef56f2a2a8ab15..b509e0264b4a32b466e90b0fd1f33403d05d68db 100644 (file)
@@ -1017,24 +1017,15 @@ PROXY_DECLARE(const char *) ap_proxy_add_balancer(proxy_balancer **balancer,
                                                   const char *url)
 {
     char *c, *q, *uri = apr_pstrdup(p, url);
-    int port;
     apr_status_t rc = 0;
 
     c = strchr(uri, ':');   
     if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0')
-       return "Bad syntax for a remote proxy server";
+       return "Bad syntax for a balancer name";
     /* remove path from uri */
     if ((q = strchr(c + 3, '/')))
         *q = '\0';
 
-    q = strchr(c + 3, ':');
-    if (q != NULL) {
-        if (sscanf(q + 1, "%u", &port) != 1 || port > 65535) {
-            return "Bad syntax for a remote proxy server (bad port number)";
-        }
-    }
-    else
-        port = -1;
     ap_str_tolower(uri);
     *balancer = apr_array_push(conf->balancers);
     (*balancer)->name = uri;
@@ -1189,7 +1180,10 @@ ap_proxy_add_worker_to_balancer(proxy_balancer *balancer, proxy_worker *worker)
                 workers[i].lbfactor -= median;
         }
     } 
-
+    for (i = 0; i < balancer->workers->nelts; i++) {
+        /* Update the status entires */
+        workers[i].lbstatus = workers[i].lbfactor;
+    }
 }
 
 PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
@@ -1421,6 +1415,7 @@ static apr_status_t init_conn_worker(proxy_worker *worker, server_rec *s)
         /* Set min to be lower then smax */
         if (worker->min > worker->smax)
             worker->min = worker->smax; 
+        worker->cp->nfree = worker->hmax;
     }
     else {
         /* This will supress the apr_reslist creation */