]> granicus.if.org Git - apache/commitdiff
Worker shared data has to be visible across all child processes,
authorMladen Turk <mturk@apache.org>
Wed, 15 Sep 2004 12:10:36 +0000 (12:10 +0000)
committerMladen Turk <mturk@apache.org>
Wed, 15 Sep 2004 12:10:36 +0000 (12:10 +0000)
so remove creating that data on per-child basis.
Thanks to Christian von Roques for the patch.

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

modules/proxy/proxy_balancer.c

index fb7c004795e52015be2617f6ae438235a7ee8d31..16d4fdd0aedc8e9731ed2c2031b463d1c3f2e7ee 100644 (file)
@@ -42,27 +42,20 @@ static int init_runtime_score(apr_pool_t *pool, proxy_balancer *balancer)
     double median, ffactor = 0.0;
     proxy_runtime_worker *workers;    
 #if PROXY_HAS_SCOREBOARD
-    lb_score *score;
-    int mpm_daemons;
+    lb_score *score = NULL;
 #else
-    void *score;
+    void *score = NULL;
 #endif
 
     workers = (proxy_runtime_worker *)balancer->workers->elts;
 
     for (i = 0; i < balancer->workers->nelts; i++) {
 #if PROXY_HAS_SCOREBOARD
-        ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &mpm_daemons);
-        /* Check if we are prefork or single child */
-        if (workers[i].w->hmax && mpm_daemons > 1) {
-            score = ap_get_scoreboard_lb(getpid(), workers[i].id);
-        }
-        else
+        /* Get scoreboard slot */
+        score = ap_get_scoreboard_lb(workers[i].id);
 #endif
-        {
-            /* Use the plain memory */
+        if (!score)
             score = apr_pcalloc(pool, sizeof(proxy_runtime_stat));
-        }
         workers[i].s = (proxy_runtime_stat *)score;
     }