if(be != NULL) {
/* startup a specific backend database */
- LDAP_TAILQ_INIT( &be->be_pending_csn_list );
+ be->be_pending_csn_list = (struct be_pcl *)
+ ch_calloc( 1, sizeof( struct be_pcl ));
+ LDAP_TAILQ_INIT( be->be_pending_csn_list );
#ifdef NEW_LOGGING
LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n",
/* append global access controls */
acl_append( &backendDB[i].be_acl, global_acl );
- LDAP_TAILQ_INIT( &backendDB[i].be_pending_csn_list );
+ backendDB[i].be_pending_csn_list = (struct be_pcl *)
+ ch_calloc( 1, sizeof( struct be_pcl ));
+ LDAP_TAILQ_INIT( backendDB[i].be_pending_csn_list );
if ( backendDB[i].be_suffix == NULL ) {
#ifdef NEW_LOGGING
glueOpened = 1;
gi->bd.be_acl = be->be_acl;
+ gi->bd.be_pending_csn_list = be->be_pending_csn_list;
if (gi->bd.bd_info->bi_db_open)
rc = gi->bd.bd_info->bi_db_open(&gi->bd);
#ifdef LDAP_SCOPE_SUBORDINATE
case LDAP_SCOPE_SUBORDINATE: /* FIXME */
#endif
+
+ if ( op->o_sync_mode & SLAP_SYNC_REFRESH ) {
+ op->o_bd = glue_back_select (b0, op->o_req_ndn.bv_val);
+
+ if (op->o_bd && op->o_bd->be_search) {
+ rs->sr_err = op->o_bd->be_search( op, rs );
+ } else {
+ send_ldap_error(op, rs, LDAP_UNWILLING_TO_PERFORM,
+ "No search target found");
+ }
+ return rs->sr_err;
+ }
+
op->o_callback = &cb;
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
scope0 = op->ors_scope;
ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, ce_csn_link ) {
+ LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
csne->ce_state = SLAP_CSN_COMMIT;
break;
}
}
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, ce_csn_link ) {
+ LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_state == SLAP_CSN_COMMIT ) committed_csne = csne;
if ( csne->ce_state == SLAP_CSN_PENDING ) break;
}
ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, ce_csn_link ) {
+ LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
csne->ce_state = SLAP_CSN_PENDING;
break;
ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, ce_csn_link ) {
+ LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
- LDAP_TAILQ_REMOVE( &op->o_bd->be_pending_csn_list,
+ LDAP_TAILQ_REMOVE( op->o_bd->be_pending_csn_list,
csne, ce_csn_link );
ch_free( csne->ce_csn->bv_val );
ch_free( csne->ce_csn );
pending->ce_connid = op->o_connid;
pending->ce_opid = op->o_opid;
pending->ce_state = SLAP_CSN_PENDING;
- LDAP_TAILQ_INSERT_TAIL( &op->o_bd->be_pending_csn_list,
+ LDAP_TAILQ_INSERT_TAIL( op->o_bd->be_pending_csn_list,
pending, ce_csn_link );
ldap_pvt_thread_mutex_unlock( &op->o_bd->be_pcl_mutex );
}
LDAP_STAILQ_ENTRY( syncinfo_s ) si_next;
} syncinfo_t;
+LDAP_TAILQ_HEAD( be_pcl, slap_csn_entry );
+
struct slap_backend_db {
BackendInfo *bd_info; /* pointer to shared backend info */
char *be_replogfile; /* replication log file (in master) */
struct berval be_update_ndn; /* allowed to make changes (in replicas) */
BerVarray be_update_refs; /* where to refer modifying clients to */
- LDAP_TAILQ_HEAD( be_pcl, slap_csn_entry ) be_pending_csn_list;
+ struct be_pcl *be_pending_csn_list;
ldap_pvt_thread_mutex_t be_pcl_mutex;
struct berval be_context_csn;
ldap_pvt_thread_mutex_t be_context_csn_mutex;