From: Howard Chu Date: Tue, 17 Mar 2009 00:56:23 +0000 (+0000) Subject: More for ITS#6011 X-Git-Tag: ACLCHECK_0~678 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=47f31dcd8ed460747d639df9017dd4ad66e0e02b;p=openldap More for ITS#6011 --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 145ea24b56..73a56a3ccf 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1258,11 +1258,11 @@ do_syncrepl( int i, defer = 1, fail = 0; Backend *be; - Debug( LDAP_DEBUG_TRACE, "=>do_syncrepl %s\n", si->si_ridtxt, 0, 0 ); - if ( si == NULL ) return NULL; + Debug( LDAP_DEBUG_TRACE, "=>do_syncrepl %s\n", si->si_ridtxt, 0, 0 ); + /* Don't get stuck here while a pause is initiated */ while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) { if ( slapd_shutdown ) @@ -4597,11 +4597,15 @@ syncrepl_config( ConfigArgs *c ) * happen when running on the cn=config DB. */ if ( si->si_re ) { - if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) { + Connection *c; + if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) isrunning = 1; - } else { + c = si->si_conn; + si->si_conn = NULL; + if ( c ) + connection_client_stop( c ); + if ( !isrunning ) ldap_pvt_thread_mutex_unlock( &si->si_mutex ); - } } if ( si->si_re && isrunning ) { si->si_ctype = 0;