]> git.sur5r.net Git - openldap/commitdiff
ITS#4933 use ldap_set_option for search timelimit
authorHoward Chu <hyc@openldap.org>
Tue, 19 Jun 2007 11:49:50 +0000 (11:49 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 19 Jun 2007 11:49:50 +0000 (11:49 +0000)
servers/slapd/syncrepl.c

index 45d6e6d509b7479700a6e5f98f1466b0c1c694b0..069d2ee754b4fbc0cf83c9be60f3e07960da7b82 100644 (file)
@@ -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.
         */