<reuse_pool> may be set on check to instruct that connection reuse may
be performed for server health checks.
As expected, this field is duplicated in srv_settings_cpy(). However,
there is an exception for rHTTP servers as in this case check-reuse-pool
must be forcefully activated, as performed in srv_settings_init(). Thus,
the value was not copied to avoid changing it to 0.
This causes a configuration issue with rHTTP on server-template though.
In this case, check-reuse-pool is not set for duplicated server
instances as srv_settings_init() is not called for them. This causes
checks to always fail for such entries.
Fix this by forcing check-reuse-pool for rHTTP in srv_settings_cpy(),
and duplicate the values for other servers.
This must be backported up to 3.2.
srv->check.tcpcheck = tcpcheck;
}
- if (!(srv->flags & SRV_F_RHTTP))
- srv->check.reuse_pool = src->check.reuse_pool;
+ /* For rHTTP check-reuse-pool is forcefully set. Duplicate the source
+ * value in other cases as expected.
+ */
+ srv->check.reuse_pool = srv->flags & SRV_F_RHTTP ?
+ 1 : src->check.reuse_pool;
+
if (src->check.pool_conn_name)
srv->check.pool_conn_name = strdup(src->check.pool_conn_name);
/* Note: 'flags' field has potentially been already initialized. */