]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit op initialization, runqueue startup latency
authorHoward Chu <hyc@openldap.org>
Mon, 3 Oct 2005 04:49:35 +0000 (04:49 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 3 Oct 2005 04:49:35 +0000 (04:49 +0000)
servers/slapd/overlays/syncprov.c

index 1a863686926142a835d53392014bca47c5888ca2..f59a2c140823aaa671f2e57eeb11f03630980725 100644 (file)
@@ -834,9 +834,10 @@ syncprov_qtask( void *ctx, void *arg )
        BackendDB be;
 
        op = (Operation *)opbuf;
-       memset( op, 0, sizeof(opbuf));
+       *op = *so->s_op;
        op->o_hdr = (Opheader *)(op+1);
        op->o_controls = (void **)(op->o_hdr+1);
+       memset( op->o_controls, 0, SLAP_MAX_CIDS * sizeof(void *));
 
        *op->o_hdr = *so->s_op->o_hdr;
 
@@ -905,7 +906,8 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
                                syncprov_qtask, so, "syncprov_qtask",
                                so->s_op->o_conn->c_peer_name.bv_val );
                } else {
-                       if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask )) {
+                       if (!ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) &&
+                               !so->s_qtask->next_sched.tv_sec ) {
                                so->s_qtask->interval.tv_sec = 0;
                                ldap_pvt_runqueue_resched( &slapd_rq, so->s_qtask, 0 );
                                so->s_qtask->interval.tv_sec = RUNQ_INTERVAL;