From d967283d1f43673a88a79de64317340b04cbcee6 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 15 Sep 2004 12:10:36 +0000 Subject: [PATCH] Worker shared data has to be visible across all child processes, 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 | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/modules/proxy/proxy_balancer.c b/modules/proxy/proxy_balancer.c index fb7c004795..16d4fdd0ae 100644 --- a/modules/proxy/proxy_balancer.c +++ b/modules/proxy/proxy_balancer.c @@ -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; } -- 2.40.0