httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <>
Subject Re: svn commit: r573264 - /httpd/httpd/trunk/include/scoreboard.h
Date Fri, 07 Sep 2007 22:20:07 GMT

On 09/07/2007 03:03 PM, Jim Jagielski wrote:
> On Sep 7, 2007, at 6:29 AM, jean-frederic clere wrote:
>> I think I have patched it. Could you try it?
> Ahh... this is much nicer that my idea of breaking out
> the data struct defs from the rest of mod_proxy.h

I do not share this view and think that we should do this
differently (haven't worked out a patch so far).

1. IMHO we change the public API with jean-frederic's patch
   (we remove ap_proxy_lb_workers from mod_proxy.h so a major
    bump would be due IMHO).

2. I do not like the very close coupling of scoreboard.h and mod_proxy via
   the inclusion of mod_proxy.h.
   By having ap_proxy_lb_workers as an optional function we decoupled both
   as far as possible. The only reasons I see why we define a more or less
   useful type for lb_score is that

   1. We need the size of the struct for the calculation of the scoreboard
   2. We need the size of the struct in ap_get_scoreboard_lb to get
      the correct worker slot.

   Why don't we do this with another optional function that just delivers
   the size of proxy_worker_stat and use an incomplete type for lb_score
   that hides all the details like we do in APR?
   Then we could do something like
        typedef struct proxy_worker_stat lb_score
   in scoreboard.h.

   and do something like

   return (lb_score *) (&((char *) (ap_scoreboard_image->balancers))[lb_size * lb_num]);

   in ap_get_scoreboard_lb
   where lb_size is the size of the struct (saved in a static var like we do with
   lb_limit) or we do something like
       typedef char lb_score
   in scoreboard.h.

   and do something like

   return &ap_scoreboard_image->balancers[lb_size * lb_num];



View raw message