httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy proxy_balancer.c
Date Wed, 15 Sep 2004 12:10:37 GMT
mturk       2004/09/15 05:10:37

  Modified:    modules/proxy proxy_balancer.c
  Log:
  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.
  
  Revision  Changes    Path
  1.20      +5 -12     httpd-2.0/modules/proxy/proxy_balancer.c
  
  Index: proxy_balancer.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_balancer.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- proxy_balancer.c	11 Sep 2004 16:39:38 -0000	1.19
  +++ proxy_balancer.c	15 Sep 2004 12:10:36 -0000	1.20
  @@ -42,27 +42,20 @@
       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;
       }
   
  
  
  

Mime
View raw message