From 84290139575219cf97e0299b7eddf86efdab56d3 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 20 Nov 2007 14:56:20 +0000 Subject: [PATCH] Fix test050 --- servers/slapd/bconfig.c | 12 ++++++++++-- servers/slapd/connection.c | 1 + servers/slapd/syncrepl.c | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 4564a6f503..7aa86fbbad 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -4909,6 +4909,7 @@ config_back_modify( Operation *op, SlapReply *rs ) struct berval rdn; char *ptr; AttributeDescription *rad = NULL; + int do_pause = 1; cfb = (CfBackInfo *)op->o_bd->be_private; @@ -4939,11 +4940,17 @@ config_back_modify( Operation *op, SlapReply *rs ) rs->sr_text = "Use modrdn to change the entry name"; goto out; } + /* Internal update of contextCSN? */ + if ( ml->sml_desc == slap_schema.si_ad_contextCSN && op->o_conn->c_conn_idx == -1 ) { + do_pause = 0; + break; + } } slap_mods_opattrs( op, &op->orm_modlist, 1 ); - ldap_pvt_thread_pool_pause( &connection_pool ); + if ( do_pause ) + ldap_pvt_thread_pool_pause( &connection_pool ); /* Strategy: * 1) perform the Modify on the cached Entry. @@ -4975,7 +4982,8 @@ config_back_modify( Operation *op, SlapReply *rs ) op->o_ndn = ndn; } - ldap_pvt_thread_pool_resume( &connection_pool ); + if ( do_pause ) + ldap_pvt_thread_pool_resume( &connection_pool ); out: send_ldap_result( op, rs ); slap_graduate_commit_csn( op ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index c2e5a74318..1b8f87381f 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1257,6 +1257,7 @@ void connection_client_stop( c->c_listener = NULL; c->c_conn_state = SLAP_C_INVALID; c->c_struct_state = SLAP_C_UNUSED; + c->c_sd = AC_SOCKET_INVALID; c->c_close_reason = "?"; /* should never be needed */ sb = c->c_sb; c->c_sb = ber_sockbuf_alloc( ); diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 085e59f12d..951fb34099 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -522,6 +522,7 @@ do_syncrep1( if ( ber_bvarray_dup_x( &si->si_syncCookie.ctxcsn, si->si_cookieState->cs_vals, NULL )) { rc = LDAP_NO_MEMORY; + ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex ); goto done; } si->si_syncCookie.numcsns = si->si_cookieState->cs_num; -- 2.39.5