diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-05-09 03:23:59 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-05-09 03:23:59 +0200 |
commit | 21cdbc98542e5bf2ab504392f6d3328006a193f4 (patch) | |
tree | a9feb07ceed1a85793a315574a3f31c7013696c4 /modules/proxy/mod_proxy_balancer.c | |
parent | Transforms. (diff) | |
download | apache2-21cdbc98542e5bf2ab504392f6d3328006a193f4.tar.xz apache2-21cdbc98542e5bf2ab504392f6d3328006a193f4.zip |
mod_proxy_balancer: follow up to r1830800.
Don't call slotmem_attach() if the slot is already initialized/reused, that
used to work previously because the returned error status is ignored, but
r1830800 changed the function to forcibly reset the returned slot pointer to
NULL first.
There is no point to call slotmem_attach() in this case, the slot is already
initialized because it's either inherited/fork()ed on Unixes, or on Windows
the attachment happened in post_config/slotmem_create() already.
One case where slotmem_attach() would fail is when balancers are defined
globally (main server) and some virtualhosts don't have/use any mod_proxy
configuration/directive. In this case their proxy server config is a pointer
copy of the main server thus their slots are already initialized in both
post_config and child_init hooks. While the case was already handled in
the balancer_post_config(), it did not in balancer_child_init() where we
relied on slotmem_attach() to be a noop.
[Reverted by r1831396]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831218 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/mod_proxy_balancer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 7e03960d12..975811d472 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -1885,7 +1885,7 @@ static void balancer_child_init(apr_pool_t *p, server_rec *s) proxy_server_conf *conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module); apr_status_t rv; - if (conf->balancers->nelts) { + if (conf->balancers->nelts && !conf->bslot) { apr_size_t size; unsigned int num; storage->attach(&(conf->bslot), conf->id, &size, &num, p); |