]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1907024 from trunk:
authorEric Covener <covener@apache.org>
Fri, 3 Mar 2023 14:21:59 +0000 (14:21 +0000)
committerEric Covener <covener@apache.org>
Fri, 3 Mar 2023 14:21:59 +0000 (14:21 +0000)
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.

Reviewed By: jailletc36, covener, rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908027 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/pr66421.txt [new file with mode: 0644]
modules/ldap/util_ldap.c

diff --git a/changes-entries/pr66421.txt b/changes-entries/pr66421.txt
new file mode 100644 (file)
index 0000000..94d4c42
--- /dev/null
@@ -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 <bzapache nailyk.fr>, Christophe Jaillet]
index 4d92ec9a5e1c4844b9d319a8bd1e530417c02328..14b774a0d82e6bc7a61eedaa77fbe94a35aa21c5 100644 (file)
@@ -2752,12 +2752,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";
     }