]> granicus.if.org Git - apache/commitdiff
mod_proxy_balancer: follow up tp r1822509.
authorYann Ylavic <ylavic@apache.org>
Wed, 31 Jan 2018 13:55:53 +0000 (13:55 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 31 Jan 2018 13:55:53 +0000 (13:55 +0000)
Use a unique balancer id per vhost for workers' slotmem too.

[Reverted by r1822806]

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

modules/proxy/mod_proxy_balancer.c

index bdefc8f54e3cb3c88c413d914b826592e7a831e7..56edd2e6c548f58897401d2459e0985fb16e14c0 100644 (file)
@@ -792,7 +792,7 @@ static int balancer_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                           (s->defn_name ? s->defn_name : "?"),
                           s->defn_line_number,
                           (s->error_fname ? s->error_fname : DEFAULT_ERRORLOG));
-        conf->id = apr_psprintf(pconf, "p%x",
+        conf->id = apr_psprintf(pconf, "balancers.p%x",
                                 ap_proxy_hashfunc(id, PROXY_HASHFUNC_DEFAULT));
         if (conf->bslot) {
             /* Shared memory already created for this proxy_server_conf.
@@ -830,6 +830,7 @@ static int balancer_post_config(apr_pool_t *pconf, apr_pool_t *plog,
             proxy_balancer_shared *bshm;
             const char *sname;
             unsigned int index;
+            char *balancer_id;
 
             /* now that we have the right id, we need to redo the sname field */
             ap_pstr2_alnum(pconf, balancer->s->name + sizeof(BALANCER_PREFIX) - 1,
@@ -875,13 +876,17 @@ static int balancer_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                 return !OK;
             }
 
+            balancer_id = apr_psprintf(ptemp, "%s.%s",
+                                       conf->id, balancer->s->sname);
+
             /* create slotmem slots for workers */
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01184) "Doing workers create: %s (%s), %d, %d [%u]",
-                         balancer->s->name, balancer->s->sname,
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01184)
+                         "Doing workers create: %s (%s), %d, %d [%u]",
+                         balancer->s->name, balancer_id,
                          (int)ALIGNED_PROXY_WORKER_SHARED_SIZE,
                          (int)balancer->max_workers, i);
 
-            rv = storage->create(&new, balancer->s->sname,
+            rv = storage->create(&new, balancer_id,
                                  ALIGNED_PROXY_WORKER_SHARED_SIZE,
                                  balancer->max_workers, type, pconf);
             if (rv != APR_SUCCESS) {