From: Christophe Jaillet Date: Fri, 27 Jan 2023 12:58:32 +0000 (+0000) Subject: LDAPConnectionPoolTTL should accept negative values in order to allow X-Git-Tag: 2.5.0-alpha2-ci-test-only~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2d18fb704c64ce7767e07fe546eecec98c91b50;p=thirdparty%2Fapache%2Fhttpd.git LDAPConnectionPoolTTL should accept negative values in order to allow connections of any age to be reused. Up to now, a negative value was handled as an error when parsing the configuration file. PR 66421. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907024 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/pr66421.txt b/changes-entries/pr66421.txt new file mode 100644 index 00000000000..94d4c42adad --- /dev/null +++ b/changes-entries/pr66421.txt @@ -0,0 +1,4 @@ + *) mod_ldap: LDAPConnectionPoolTTL should accept negative values in order to + allow connections of any age to be reused. Up to now, a negative value + was handled as an error when parsing the configuration file. PR 66421. + [nailyk , Christophe Jaillet] diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 759a5bba5e9..98dfe90ac45 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -2817,12 +2817,14 @@ static const char *util_ldap_set_conn_ttl(cmd_parms *cmd, void *dummy, const char *val) { - apr_interval_time_t timeout; + apr_interval_time_t timeout = -1; util_ldap_state_t *st = (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, &ldap_module); - if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS) { + /* Negative values mean AP_LDAP_CONNPOOL_INFINITE */ + if (val[0] != '-' && + ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS) { return "LDAPConnectionPoolTTL has wrong format"; }