Ruediger Pluem wrote:

On 08/03/2006 06:01 PM, [EMAIL PROTECTED] wrote:
Author: jfclere
Date: Thu Aug  3 09:01:50 2006
New Revision: 428437

URL: http://svn.apache.org/viewvc?rev=428437&view=rev
Log:
Use only one slotmem for status and checker.

Modified:
   
httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c

Modified: 
httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
URL: 
http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c?rev=428437&r1=428436&r2=428437&view=diff
==============================================================================
--- 
httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
 (original)
+++ 
httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy_health_checker.c
 Thu Aug  3 09:01:50 2006
@@ -40,13 +40,19 @@
{
    const health_worker_method *worker_storage;
    worker_storage = ap_lookup_provider(PROXY_CKMETHOD, "default", "0");
+    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
+                                                    &proxy_module);
+    char *slotmem_loc = sconf->slotmem_loc;
if (worker_storage) {
        apr_status_t rv;
-        rv = worker_storage->create_slotmem("proxy/checker", 
ap_proxy_lb_workers(), pconf);
+        if (!slotmem_loc)
+            slotmem_loc = apr_pstrcat(pconf, ":", proxy_module.name, NULL);
+
+        rv = worker_storage->create_slotmem(slotmem_loc, 
ap_proxy_lb_workers(), pconf);

Sorry for being confused, but in one case you store a (struct 
proxy_worker_conf) in this slotmemory and
in proxy_util you use the same area to store a proxy_worker_stat entry. So as 
far as I understand it you
store different structures, with different sizes in the same memory. Does this 
really work?
+++
[EMAIL PROTECTED]:~/httpd-proxy-scoreboard/modules/proxy$ grep ap_slotmem_create *.c health_checker_util.c: rv = checkstorage->ap_slotmem_create(&myscore, name, sizeof(struct proxy_worker_conf), item_num, pool); proxy_util.c: storage->ap_slotmem_create(&myscore, slotmem_loc, sizeof(proxy_worker_stat), ap_proxy_lb_workers(), pconf);
+++
That looks wrong, but if you look in ap_slotmem_create you will see that it first looks to the slotmems already created and only checks the name. Of course that only works because the struct proxy_worker_conf first element is a proxy_worker_stat.

Cheers

Jean-Frederic

Regards

RĂ¼diger


Reply via email to