]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Try to have something that has the right size.
authorJean-Frederic Clere <jfclere@apache.org>
Wed, 26 Jul 2006 15:21:19 +0000 (15:21 +0000)
committerJean-Frederic Clere <jfclere@apache.org>
Wed, 26 Jul 2006 15:21:19 +0000 (15:21 +0000)
The remaining problem is that proxy_lb_workers() only gives a good value when
the config file has been parsed (can't be used in preconfig().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-proxy-scoreboard@425759 13f79535-47bb-0310-9956-ffa450edef68

modules/mem/mod_scoreboard.c

index 03038b11e131acfc1ff47aa13d74e40e5a698dbd..7b7f0ea8b40fc98417006314fe0be80850865651 100644 (file)
@@ -87,7 +87,19 @@ static apr_status_t ap_slotmem_create(ap_slotmem_t **new, const char *name, apr_
 
 static apr_status_t ap_slotmem_attach(ap_slotmem_t **new, const char *name, apr_size_t *item_size, int *item_num, apr_pool_t *pool)
 {
-    return(ap_slotmem_create(new, name, item_size, item_num, pool));
+    apr_size_t size;
+    int num;
+    apr_status_t rv;
+
+    size = sizeof(lb_score);
+    /* XXX: proxy_lb_workers only returns something valid after parsing the configuration */
+    num =  proxy_lb_workers();
+    rv = ap_slotmem_create(new, name, size, num, pool);
+    if (rv == APR_SUCCESS) {
+        *item_size = size;
+        *item_num = num;
+    }
+    return rv;
 }
 
 static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
@@ -112,6 +124,7 @@ static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
 static const slotmem_storage_method storage = {
     &ap_slotmem_do,
     &ap_slotmem_create,
+    &ap_slotmem_attach,
     &ap_slotmem_mem
 };