From: Howard Chu Date: Wed, 12 Jan 2005 01:49:00 +0000 (+0000) Subject: ITS#3463 don't muck with frontend's operations, just our detached ones X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~419 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=53fcde09273c03ae7e6f79b73cec967228d722c2;p=openldap ITS#3463 don't muck with frontend's operations, just our detached ones --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 755917e1d9..0bdf978ffa 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -84,6 +84,7 @@ typedef struct sync_control { #define SLAP_SYNC_REFRESH_AND_PERSIST (LDAP_SYNC_REFRESH_AND_PERSIST<s_mutex ); - filter_free( so->s_op->ors_filter ); - for ( ga = so->s_op->o_groups; ga; ga=gnext ) { - gnext = ga->ga_next; - ch_free( ga ); + if ( so->s_flags & PS_IS_DETACHED ) { + filter_free( so->s_op->ors_filter ); + for ( ga = so->s_op->o_groups; ga; ga=gnext ) { + gnext = ga->ga_next; + ch_free( ga ); + } + ch_free( so->s_op ); } - ch_free( so->s_op ); ch_free( so->s_base.bv_val ); for ( sr=so->s_res; sr; sr=srnext ) { srnext = sr->s_next; @@ -846,14 +849,16 @@ syncprov_free_syncop( syncops *so ) static int syncprov_drop_psearch( syncops *so, int lock ) { - if ( lock ) - ldap_pvt_thread_mutex_lock( &so->s_op->o_conn->c_mutex ); - so->s_op->o_conn->c_n_ops_executing--; - so->s_op->o_conn->c_n_ops_completed++; - LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, slap_op, - o_next ); - if ( lock ) - ldap_pvt_thread_mutex_unlock( &so->s_op->o_conn->c_mutex ); + if ( so->s_flags & PS_IS_DETACHED ) { + if ( lock ) + ldap_pvt_thread_mutex_lock( &so->s_op->o_conn->c_mutex ); + so->s_op->o_conn->c_n_ops_executing--; + so->s_op->o_conn->c_n_ops_completed++; + LDAP_STAILQ_REMOVE( &so->s_op->o_conn->c_ops, so->s_op, slap_op, + o_next ); + if ( lock ) + ldap_pvt_thread_mutex_unlock( &so->s_op->o_conn->c_mutex ); + } syncprov_free_syncop( so ); } @@ -1584,6 +1589,7 @@ syncprov_detach_op( Operation *op, syncops *so ) op->o_conn->c_n_ops_executing++; op->o_conn->c_n_ops_completed--; LDAP_STAILQ_INSERT_TAIL( &op->o_conn->c_ops, op2, o_next ); + so->s_flags |= PS_IS_DETACHED; ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); }