mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 02:29:34 -05:00
ITS#3546 fix consumer crash on interrupt (provider crash still unresolved)
This commit is contained in:
parent
583242c9a3
commit
3b34a6f81c
3 changed files with 12 additions and 0 deletions
|
|
@ -1671,6 +1671,7 @@ add_syncrepl(
|
|||
|
||||
si->si_presentlist = NULL;
|
||||
LDAP_LIST_INIT( &si->si_nonpresentlist );
|
||||
ldap_pvt_thread_mutex_init( &si->si_mutex );
|
||||
|
||||
rc = parse_syncrepl_line( cargv, cargc, si );
|
||||
|
||||
|
|
|
|||
|
|
@ -1524,6 +1524,7 @@ typedef struct syncinfo_s {
|
|||
Avlnode *si_presentlist;
|
||||
LDAP *si_ld;
|
||||
LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist;
|
||||
ldap_pvt_thread_mutex_t si_mutex;
|
||||
} syncinfo_t;
|
||||
|
||||
LDAP_TAILQ_HEAD( be_pcl, slap_csn_entry );
|
||||
|
|
|
|||
|
|
@ -527,6 +527,10 @@ do_syncrep2(
|
|||
msg != NULL;
|
||||
msg = ldap_next_message( si->si_ld, msg ) )
|
||||
{
|
||||
if ( slapd_shutdown ) {
|
||||
rc = -2;
|
||||
goto done;
|
||||
}
|
||||
switch( ldap_msgtype( msg ) ) {
|
||||
case LDAP_RES_SEARCH_ENTRY:
|
||||
ldap_get_entry_controls( si->si_ld, msg, &rctrls );
|
||||
|
|
@ -839,11 +843,14 @@ do_syncrepl(
|
|||
if ( si == NULL )
|
||||
return NULL;
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &si->si_mutex );
|
||||
|
||||
switch( abs( si->si_type )) {
|
||||
case LDAP_SYNC_REFRESH_ONLY:
|
||||
case LDAP_SYNC_REFRESH_AND_PERSIST:
|
||||
break;
|
||||
default:
|
||||
ldap_pvt_thread_mutex_unlock( &si->si_mutex );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -854,6 +861,7 @@ do_syncrepl(
|
|||
ldap_unbind( si->si_ld );
|
||||
si->si_ld = NULL;
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &si->si_mutex );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -947,6 +955,7 @@ do_syncrepl(
|
|||
}
|
||||
|
||||
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
||||
ldap_pvt_thread_mutex_unlock( &si->si_mutex );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2074,6 +2083,7 @@ avl_ber_bvfree( void *v_bv )
|
|||
void
|
||||
syncinfo_free( syncinfo_t *sie )
|
||||
{
|
||||
ldap_pvt_thread_mutex_destroy( &sie->si_mutex );
|
||||
if ( !BER_BVISNULL( &sie->si_provideruri ) ) {
|
||||
ch_free( sie->si_provideruri.bv_val );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue