]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Reinstate the lb_score patch, but, protect against
authorJim Jagielski <jim@apache.org>
Fri, 7 Sep 2007 13:13:37 +0000 (13:13 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 7 Sep 2007 13:13:37 +0000 (13:13 +0000)
conflicting leakage as per jfc proposal.

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

include/scoreboard.h
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

index 1e934cd29cf8f5bac2750e7c04426dd939a16a15..6f8b42e394c86904b2f59632aaf052cc1da5c717 100644 (file)
@@ -45,6 +45,9 @@ extern "C" {
 #define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
 #endif
 
+/* for proxy_worker_stat */
+#include "../modules/proxy/mod_proxy.h"
+
 /* Scoreboard info on a process is, for now, kept very brief --- 
  * just status value and pid (the latter so that the caretaker process
  * can properly update the scoreboard when a process dies).  We may want
@@ -142,11 +145,7 @@ struct process_score {
 };
 
 /* stuff which is lb specific */
-typedef struct lb_score lb_score;
-struct lb_score {
-    /* TODO: sync this with proxy_worker_stat */
-    unsigned char data[256];
-};
+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
index 93921b87616ff8dbfe51890fe4126f1bb01ca7f3..5ccd9e25b56af7d8cf83239974ead60db753fac4 100644 (file)
@@ -37,6 +37,27 @@ APR_DECLARE_OPTIONAL_FN(char *, ssl_var_lookup,
 #define MAX(x,y) ((x) >= (y) ? (x) : (y))
 #endif
 
+/* Global balancer counter */
+extern int PROXY_DECLARE_DATA proxy_lb_workers;
+static int lb_workers_limit = 0;
+
+/**
+ * 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;
+}
+
+
 /*
  * A Web proxy module. Stages:
  *
index 32e031315528528318bab219704d658df1271860..bb0b9c81442c1c1c437fbd4d10eded679dbe1131 100644 (file)
@@ -730,16 +730,9 @@ PROXY_DECLARE(void) ap_proxy_backend_broke(request_rec *r,
  * 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 e35b9cdc35f968f8072963cb92921ff9efb0806a..47889fbadb5e602b827792538347d286cdd3909a 100644 (file)
@@ -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,18 +2310,6 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
     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)
 {