From a68a8e491890af8dc3b03725460836ea9c77a0c6 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 12 Aug 2011 13:56:54 +0000 Subject: [PATCH] Accept LDAP_OPT_CONNECT_TIMEOUT as an alternative to LDAP_OPT_NETWORK_TIMEOUT. An alternative on at least some IBM client libraries: http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDS.doc/progref281.htm#opttimeout git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157111 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ docs/manual/mod/mod_ldap.xml | 13 +++++++------ modules/ldap/util_ldap.c | 4 ++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 59fe8d3d90..3c7c6126ed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.3.15 + *) mod_ldap: Enable LDAPConnectionTimeout for LDAP toolkits that have + LDAP_OPT_CONNECT_TIMEOUT instead of LDAP_OPT_NETWORK_TIMEOUT, such + as Tivoli Directory Server 6.3 and later. [Eric Covener] + *) mod_ldap: Change default number of retries from 10 to 3, and add an LDAPRetries and LDAPRetryDelay directives. [Eric Covener] diff --git a/docs/manual/mod/mod_ldap.xml b/docs/manual/mod/mod_ldap.xml index c725d22a93..323e17eea2 100644 --- a/docs/manual/mod/mod_ldap.xml +++ b/docs/manual/mod/mod_ldap.xml @@ -638,10 +638,10 @@ connection client certificates. server config -

This directive configures the LDAP_OPT_NETWORK_TIMEOUT option in the - underlying LDAP client library, when available. This value typically - controls how long the LDAP client library will wait for the TCP connection - to the LDAP server to complete.

+

This directive configures the LDAP_OPT_NETWORK_TIMEOUT (or LDAP_OPT_CONNECT_TIMEOUT) + option in the underlying LDAP client library, when available. This value + typically controls how long the LDAP client library will wait for the TCP + connection to the LDAP server to complete.

If a connection is not successful with the timeout period, either an error will be returned or the LDAP client library will attempt to connect to a secondary LDAP @@ -652,8 +652,9 @@ connection client certificates. server supports the LDAP_OPT_NETWORK_TIMEOUT option.

LDAPConnectionTimeout is only available when the LDAP client library linked - with the server supports the LDAP_OPT_NETWORK_TIMEOUT option, and the - ultimate behavior is dictated entirely by the LDAP client library. + with the server supports the LDAP_OPT_NETWORK_TIMEOUT + (or LDAP_OPT_CONNECT_TIMEOUT) option, and the ultimate behavior is + dictated entirely by the LDAP client library.
diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 7e0dce11e5..8a27156d4a 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -66,6 +66,10 @@ #define AP_LDAP_CONNPOOL_DEFAULT -1 #define AP_LDAP_CONNPOOL_INFINITE -2 +#if !defined(LDAP_OPT_NETWORK_TIMEOUT) && defined(LDAP_OPT_CONNECT_TIMEOUT) +#define LDAP_OPT_NETWORK_TIMEOUT LDAP_OPT_CONNECT_TIMEOUT +#endif + module AP_MODULE_DECLARE_DATA ldap_module; static const char *ldap_cache_mutex_type = "ldap-cache"; static apr_status_t uldap_connection_unbind(void *param); -- 2.40.0