- 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);