Martin Kraemer wrote:
> On Fri, Sep 07, 2007 at 10:30:13AM +0200, jean-frederic clere wrote:
>> That is going to break:
>> In mod_proxy.h:
>> int ap_proxy_lb_workers(void);
>> In server/scoreboard.c:
>> +++
>> static APR_OPTIONAL_FN_TYPE(ap_proxy_lb_workers)
>>                                 *proxy_lb_workers;
>> +++
> 
> Yes, it breaks:
> 
> scoreboard.c: In function `ap_calc_scoreboard_size':
> scoreboard.c:108: sizeof applied to an incomplete type
> scoreboard.c: In function `ap_init_scoreboard':
> scoreboard.c:134: sizeof applied to an incomplete type
> scoreboard.c: In function `ap_create_scoreboard':
> scoreboard.c:286: sizeof applied to an incomplete type
> scoreboard.c: In function `ap_get_scoreboard_lb':
> scoreboard.c:496: arithmetic on pointer to an incomplete type
> scoreboard.c:496: dereferencing pointer to incomplete type

I think I have patched it. Could you try it?

Cheers

Jean-Frederic

> 
>   Martin

Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c  (revision 573497)
+++ modules/proxy/proxy_util.c  (working copy)
@@ -31,7 +31,6 @@
 
 /* Global balancer counter */
 int PROXY_DECLARE_DATA proxy_lb_workers = 0;
-static int lb_workers_limit = 0;
 
 static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r);
 static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
@@ -2311,17 +2310,6 @@
     return OK;
 }
 
-int ap_proxy_lb_workers(void)
-{
-    /*
-     * Since we can't resize the scoreboard when reconfiguring, we
-     * have to impose a limit on the number of workers, we are
-     * able to reconfigure to.
-     */
-    if (!lb_workers_limit)
-    lb_workers_limit = proxy_lb_workers + PROXY_DYNAMIC_BALANCER_LIMIT;
-    return lb_workers_limit;
-}
 
 PROXY_DECLARE(void) ap_proxy_backend_broke(request_rec *r,
                                            apr_bucket_brigade *brigade)
Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c   (revision 573497)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -37,6 +37,9 @@
 #define MAX(x,y) ((x) >= (y) ? (x) : (y))
 #endif
 
+static int lb_workers_limit = 0;
+extern int PROXY_DECLARE_DATA proxy_lb_workers;
+
 /*
  * A Web proxy module. Stages:
  *
@@ -2203,6 +2206,21 @@
     proxy_lb_workers = 0;
     return OK;
 }
+/**
+ * Calculate number of maximum number of workers in scoreboard.
+ * @return  number of workers to allocate in the scoreboard
+ */
+static int ap_proxy_lb_workers(void)
+{
+    /*
+     * Since we can't resize the scoreboard when reconfiguring, we
+     * have to impose a limit on the number of workers, we are
+     * able to reconfigure to.
+     */
+    if (!lb_workers_limit)
+    lb_workers_limit = proxy_lb_workers + PROXY_DYNAMIC_BALANCER_LIMIT;
+    return lb_workers_limit;
+}
 static void register_hooks(apr_pool_t *p)
 {
     /* fixup before mod_rewrite, so that the proxied url will not
Index: modules/proxy/mod_proxy.h
===================================================================
--- modules/proxy/mod_proxy.h   (revision 573497)
+++ modules/proxy/mod_proxy.h   (working copy)
@@ -730,16 +730,9 @@
  * If this limit is reached you must stop and restart the server.
  */
 #define PROXY_DYNAMIC_BALANCER_LIMIT    16
-/**
- * Calculate number of maximum number of workers in scoreboard.
- * @return  number of workers to allocate in the scoreboard
- */
-int ap_proxy_lb_workers(void);
 
 /* For proxy_util */
 extern module PROXY_DECLARE_DATA proxy_module;
 
-extern int PROXY_DECLARE_DATA proxy_lb_workers;
-
 #endif /*MOD_PROXY_H*/
 /** @} */
Index: include/scoreboard.h
===================================================================
--- include/scoreboard.h        (revision 573497)
+++ include/scoreboard.h        (working copy)
@@ -145,7 +145,7 @@
 };
 
 /* stuff which is lb specific */
-typedef struct proxy_worker_stat lb_score;
+typedef proxy_worker_stat lb_score;
 
 /* Scoreboard is now in 'local' memory, since it isn't updated once created,
  * even in forked architectures.  Child created-processes (non-fork) will

Reply via email to