version 1.19, 2004/11/27 00:26:12
|
version 1.20, 2004/11/27 05:17:24
|
Line 46 typedef struct syncops {
|
Line 46 typedef struct syncops {
|
long s_rid; |
long s_rid; |
struct berval s_filterstr; |
struct berval s_filterstr; |
int s_flags; /* search status */ |
int s_flags; /* search status */ |
|
int s_inuse; /* reference count */ |
struct syncres *s_res; |
struct syncres *s_res; |
struct syncres *s_restail; |
struct syncres *s_restail; |
ldap_pvt_thread_mutex_t s_mutex; |
ldap_pvt_thread_mutex_t s_mutex; |
Line 821 syncprov_matchops( Operation *op, opcook
|
Line 822 syncprov_matchops( Operation *op, opcook
|
sm = op->o_tmpalloc( sizeof(syncmatches), op->o_tmpmemctx ); |
sm = op->o_tmpalloc( sizeof(syncmatches), op->o_tmpmemctx ); |
sm->sm_next = opc->smatches; |
sm->sm_next = opc->smatches; |
sm->sm_op = ss; |
sm->sm_op = ss; |
|
ss->s_inuse++; |
opc->smatches = sm; |
opc->smatches = sm; |
} else { |
} else { |
/* if found send UPDATE else send ADD */ |
/* if found send UPDATE else send ADD */ |
Line 840 syncprov_matchops( Operation *op, opcook
|
Line 842 syncprov_matchops( Operation *op, opcook
|
} |
} |
} |
} |
|
|
|
static void |
|
syncprov_free_syncop( syncops *so ) |
|
{ |
|
syncres *sr, *srnext; |
|
|
|
ldap_pvt_thread_mutex_lock( &so->s_mutex ); |
|
so->s_inuse--; |
|
if ( so->s_inuse > 0 ) { |
|
ldap_pvt_thread_mutex_unlock( &so->s_mutex ); |
|
return; |
|
} |
|
ldap_pvt_thread_mutex_unlock( &so->s_mutex ); |
|
filter_free( so->s_op->ors_filter ); |
|
ch_free( so->s_op ); |
|
ch_free( so->s_base.bv_val ); |
|
for ( sr=so->s_res; sr; sr=srnext ) { |
|
srnext = sr->s_next; |
|
ch_free( sr ); |
|
} |
|
ldap_pvt_thread_mutex_destroy( &so->s_mutex ); |
|
ch_free( so ); |
|
} |
|
|
static int |
static int |
syncprov_op_cleanup( Operation *op, SlapReply *rs ) |
syncprov_op_cleanup( Operation *op, SlapReply *rs ) |
{ |
{ |
Line 849 syncprov_op_cleanup( Operation *op, Slap
|
Line 874 syncprov_op_cleanup( Operation *op, Slap
|
|
|
for (sm = opc->smatches; sm; sm=snext) { |
for (sm = opc->smatches; sm; sm=snext) { |
snext = sm->sm_next; |
snext = sm->sm_next; |
|
syncprov_free_syncop( sm->sm_op ); |
op->o_tmpfree( sm, op->o_tmpmemctx ); |
op->o_tmpfree( sm, op->o_tmpmemctx ); |
} |
} |
op->o_callback = cb->sc_next; |
op->o_callback = cb->sc_next; |
Line 896 syncprov_op_response( Operation *op, Sla
|
Line 922 syncprov_op_response( Operation *op, Sla
|
/* for each match in opc->smatches: |
/* for each match in opc->smatches: |
* send DELETE msg |
* send DELETE msg |
*/ |
*/ |
|
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex ); |
for ( sm = opc->smatches; sm; sm=sm->sm_next ) { |
for ( sm = opc->smatches; sm; sm=sm->sm_next ) { |
|
if ( sm->sm_op->s_op->o_abandon ) |
|
continue; |
syncprov_sendresp( op, opc, sm->sm_op, NULL, |
syncprov_sendresp( op, opc, sm->sm_op, NULL, |
LDAP_SYNC_DELETE, 1 ); |
LDAP_SYNC_DELETE, 1 ); |
} |
} |
|
ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); |
break; |
break; |
} |
} |
} |
} |
Line 908 syncprov_op_response( Operation *op, Sla
|
Line 938 syncprov_op_response( Operation *op, Sla
|
return SLAP_CB_CONTINUE; |
return SLAP_CB_CONTINUE; |
} |
} |
|
|
static void |
|
syncprov_free_syncop( syncops *so ) |
|
{ |
|
syncres *sr, *srnext; |
|
|
|
filter_free( so->s_op->ors_filter ); |
|
ch_free( so->s_op ); |
|
ch_free( so->s_base.bv_val ); |
|
for ( sr=so->s_res; sr; sr=srnext ) { |
|
srnext = sr->s_next; |
|
ch_free( sr ); |
|
} |
|
ldap_pvt_thread_mutex_destroy( &so->s_mutex ); |
|
ch_free( so ); |
|
} |
|
|
|
static int |
static int |
syncprov_op_abandon( Operation *op, SlapReply *rs ) |
syncprov_op_abandon( Operation *op, SlapReply *rs ) |
{ |
{ |
Line 936 syncprov_op_abandon( Operation *op, Slap
|
Line 950 syncprov_op_abandon( Operation *op, Slap
|
soprev=so, so=so->s_next ) { |
soprev=so, so=so->s_next ) { |
if ( so->s_op->o_connid == op->o_connid && |
if ( so->s_op->o_connid == op->o_connid && |
so->s_op->o_msgid == op->orn_msgid ) { |
so->s_op->o_msgid == op->orn_msgid ) { |
|
so->s_op->o_abandon = 1; |
soprev->s_next = so->s_next; |
soprev->s_next = so->s_next; |
break; |
break; |
} |
} |
Line 1271 syncprov_op_search( Operation *op, SlapR
|
Line 1286 syncprov_op_search( Operation *op, SlapR
|
sop->s_sid = srs->sr_state.sid; |
sop->s_sid = srs->sr_state.sid; |
sop->s_rid = srs->sr_state.rid; |
sop->s_rid = srs->sr_state.rid; |
sop->s_next = si->si_ops; |
sop->s_next = si->si_ops; |
|
sop->s_inuse = 1; |
si->si_ops = sop; |
si->si_ops = sop; |
ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); |
ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex ); |
} |
} |