summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Frederic Clere <jfclere@apache.org>2006-07-26 15:21:19 +0000
committerJean-Frederic Clere <jfclere@apache.org>2006-07-26 15:21:19 +0000
commit4963008b415c65e040ef5389d41d393767b0c8fd (patch)
treee02ad4019d210693e6ea730a1cbddcde170e51e6
parentcd6979529ea0faafa42eddbdf9dbe1cca7b79498 (diff)
downloadhttpd-4963008b415c65e040ef5389d41d393767b0c8fd.tar.gz
Try to have something that has the right size.
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
-rw-r--r--modules/mem/mod_scoreboard.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/mem/mod_scoreboard.c b/modules/mem/mod_scoreboard.c
index 03038b11e1..7b7f0ea8b4 100644
--- a/modules/mem/mod_scoreboard.c
+++ b/modules/mem/mod_scoreboard.c
@@ -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
};