summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/dna/dna.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/plugins/dna/dna.c')
-rw-r--r--ldap/servers/plugins/dna/dna.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index 0f509c05..b198ef3a 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -53,7 +53,6 @@
#include "dirlite_strings.h"
#include "dirver.h"
#include "prclist.h"
-#include "ldif.h"
/* Required to get portable printf/scanf format macros */
#ifdef HAVE_INTTYPES_H
@@ -1499,7 +1498,10 @@ static int dna_request_range(struct configEntry *config_entry,
int set_extend_flag = 0;
int ret = LDAP_OPERATIONS_ERROR;
int port = 0;
-
+ int timelimit;
+#if defined(USE_OPENLDAP)
+ struct timeval timeout;
+#endif
/* See if we're allowed to send a range request now */
slapi_lock_mutex(config_entry->extend_lock);
if (config_entry->extend_in_progress) {
@@ -1543,9 +1545,15 @@ static int dna_request_range(struct configEntry *config_entry,
/* Disable referrals and set timelimit and a connect timeout */
ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF);
- ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &config_entry->timeout);
+ timelimit = config_entry->timeout / 1000; /* timeout is in msec */
+ ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &timelimit);
+#if defined(USE_OPENLDAP)
+ timeout.tv_sec = config_entry->timeout / 1000;
+ timeout.tv_usec = (config_entry->timeout % 1000) * 1000;
+ ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
+#else
ldap_set_option(ld, LDAP_X_OPT_CONNECT_TIMEOUT, &config_entry->timeout);
-
+#endif
/* Bind to the replica server */
ret = slapi_ldap_bind(ld, bind_dn, bind_passwd, bind_method,
NULL, NULL, NULL, NULL);