From: Howard Chu Date: Tue, 19 Jun 2007 11:49:50 +0000 (+0000) Subject: ITS#4933 use ldap_set_option for search timelimit X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~375 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=299d19506a721d540c2b418e94b465b331c3e52d;p=openldap ITS#4933 use ldap_set_option for search timelimit --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 45d6e6d509..069d2ee754 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -320,7 +320,6 @@ ldap_sync_search( BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; LDAPControl c[2], *ctrls[3]; - struct timeval timeout; ber_int_t msgid; int rc; int rhint; @@ -405,12 +404,8 @@ ldap_sync_search( ctrls[1] = NULL; } - timeout.tv_sec = si->si_tlimit; - timeout.tv_usec = 0; - rc = ldap_search_ext( si->si_ld, base, scope, filter, attrs, attrsonly, - ctrls, NULL, si->si_tlimit > 0 ? &timeout : NULL, - si->si_slimit, &msgid ); + ctrls, NULL, NULL, si->si_slimit, &msgid ); ber_free_buf( ber ); return rc; } @@ -449,6 +444,8 @@ do_syncrep1( op->o_ssf = ( op->o_sasl_ssf > op->o_tls_ssf ) ? op->o_sasl_ssf : op->o_tls_ssf; + ldap_set_option( si->si_ld, LDAP_OPT_TIMELIMIT, &si->si_tlimit ); + /* We've just started up, or the remote server hasn't sent us * any meaningful state. */