connection_fake_init( &conn, &opbuf, ctx );
op = &opbuf.ob_op;
- /* use global malloc for now */
- op->o_tmpmemctx = NULL;
- op->o_tmpmfuncs = &ch_mfuncs;
-
op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
be = si->si_be;
do {
si_next = sie->si_next;
- sie->si_re = NULL;
-
if ( sie->si_ld ) {
if ( sie->si_conn ) {
connection_client_stop( sie->si_conn );
si->si_cookieState = c->be->be_syncinfo->si_cookieState;
- // add new syncrepl to end of list (same order as when deleting)
+ /* add new syncrepl to end of list (same order as when deleting) */
for ( sip = c->be->be_syncinfo; sip->si_next; sip = sip->si_next );
sip->si_next = si;
} else {
if ( si->si_re ) {
if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
isrunning = 1;
- } else if ( si->si_conn ) {
- isrunning = 1;
- /* If there's a persistent connection, we don't
- * know if it's already got a thread queued.
- * so defer the free, but reschedule the task.
- * If there's a connection thread queued, it
- * will cleanup as necessary. If not, then the
- * runqueue task will cleanup.
- */
- ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
- if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, si->si_re )) {
- si->si_re->interval.tv_sec = 0;
- ldap_pvt_runqueue_resched( &slapd_rq, si->si_re, 0 );
- si->si_re->interval.tv_sec = si->si_interval;
- }
- ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
-
} else {
+ if ( si->si_conn ) {
+ isrunning = 1;
+ /* If there's a persistent connection, we don't
+ * know if it's already got a thread queued.
+ * so defer the free, but reschedule the task.
+ * If there's a connection thread queued, it
+ * will cleanup as necessary. If not, then the
+ * runqueue task will cleanup.
+ */
+ ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+ if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, si->si_re )) {
+ si->si_re->interval.tv_sec = 0;
+ ldap_pvt_runqueue_resched( &slapd_rq, si->si_re, 0 );
+ si->si_re->interval.tv_sec = si->si_interval;
+ }
+ ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+ }
ldap_pvt_thread_mutex_unlock( &si->si_mutex );
}
}