You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2023/03/03 14:21:59 UTC

svn commit: r1908027 - in /httpd/httpd/branches/2.4.x: ./ changes-entries/pr66421.txt modules/ldap/util_ldap.c

Author: covener
Date: Fri Mar  3 14:21:59 2023
New Revision: 1908027

URL: http://svn.apache.org/viewvc?rev=1908027&view=rev
Log:
Merge r1907024 from trunk:

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

Added:
    httpd/httpd/branches/2.4.x/changes-entries/pr66421.txt
      - copied unchanged from r1907024, httpd/httpd/trunk/changes-entries/pr66421.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1907024

Modified: httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c?rev=1908027&r1=1908026&r2=1908027&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c Fri Mar  3 14:21:59 2023
@@ -2752,12 +2752,14 @@ static const char *util_ldap_set_conn_tt
                                           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";
     }