Diff for /servers/slapd/overlays/syncprov.c between versions 1.223 and 1.230

version 1.223, 2008/03/19 23:31:42 version 1.230, 2008/04/24 16:35:35
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.222 2008/03/19 23:26:14 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.229 2008/04/16 22:03:06 hyc Exp $ */
 /* syncprov.c - syncrepl provider */  /* syncprov.c - syncrepl provider */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
Line 696  again: Line 696  again:
                 break;                  break;
         }          }
   
         if ( on->on_next )          fop.o_bd->bd_info = (BackendInfo *)on->on_info;
                 fop.o_bd->bd_info = (BackendInfo *)on->on_next;  
         else  
                 fop.o_bd->bd_info = on->on_info->oi_orig;  
         fop.o_bd->be_search( &fop, &frs );          fop.o_bd->be_search( &fop, &frs );
         fop.o_bd->bd_info = (BackendInfo *)on;          fop.o_bd->bd_info = (BackendInfo *)on;
   
Line 740  syncprov_free_syncop( syncops *so ) Line 737  syncprov_free_syncop( syncops *so )
                 ldap_pvt_thread_mutex_unlock( &so->s_mutex );                  ldap_pvt_thread_mutex_unlock( &so->s_mutex );
                 return;                  return;
         }          }
           if ( so->s_qtask ) {
                   ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
                   if ( ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) )
                           ldap_pvt_runqueue_stoptask( &slapd_rq, so->s_qtask );
                   ldap_pvt_runqueue_remove( &slapd_rq, so->s_qtask );
                   ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
           }
         ldap_pvt_thread_mutex_unlock( &so->s_mutex );          ldap_pvt_thread_mutex_unlock( &so->s_mutex );
         if ( so->s_flags & PS_IS_DETACHED ) {          if ( so->s_flags & PS_IS_DETACHED ) {
                 filter_free( so->s_op->ors_filter );                  filter_free( so->s_op->ors_filter );
Line 1531  syncprov_playlog( Operation *op, SlapRep Line 1535  syncprov_playlog( Operation *op, SlapRep
                 fop.ors_filter = &af;                  fop.ors_filter = &af;
   
                 cb.sc_response = playlog_cb;                  cb.sc_response = playlog_cb;
                 if ( on->on_next )                  fop.o_bd->bd_info = (BackendInfo *)on->on_info;
                         fop.o_bd->bd_info = (BackendInfo *)on->on_next;  
                 else  
                         fop.o_bd->bd_info = on->on_info->oi_orig;  
   
                 for ( i=ndel; i<num; i++ ) {                  for ( i=ndel; i<num; i++ ) {
                         if ( uuids[i].bv_len == 0 ) continue;                          if ( uuids[i].bv_len == 0 ) continue;
Line 1555  syncprov_playlog( Operation *op, SlapRep Line 1556  syncprov_playlog( Operation *op, SlapRep
         if ( ndel ) {          if ( ndel ) {
                 struct berval cookie;                  struct berval cookie;
   
                 slap_compose_sync_cookie( op, &cookie, delcsn, srs->sr_state.rid,                  if ( delcsn[0].bv_len ) {
                         srs->sr_state.sid );                          slap_compose_sync_cookie( op, &cookie, delcsn, srs->sr_state.rid,
                                   srs->sr_state.sid );
                   }
   
                 Debug( LDAP_DEBUG_SYNC, "syncprov_playlog: cookie=%s\n", cookie.bv_val, 0, 0 );                  Debug( LDAP_DEBUG_SYNC, "syncprov_playlog: cookie=%s\n", cookie.bv_val, 0, 0 );
   
                 uuids[ndel].bv_val = NULL;                  uuids[ndel].bv_val = NULL;
                 syncprov_sendinfo( op, rs, LDAP_TAG_SYNC_ID_SET, &cookie, 0, uuids, 1 );                  syncprov_sendinfo( op, rs, LDAP_TAG_SYNC_ID_SET,
                           delcsn[0].bv_len ? &cookie : NULL, 0, uuids, 1 );
                 op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );                  op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
         }          }
         op->o_tmpfree( uuids, op->o_tmpmemctx );          op->o_tmpfree( uuids, op->o_tmpmemctx );
Line 2246  no_change:  if ( !(op->o_sync_mode & SLA Line 2250  no_change:  if ( !(op->o_sync_mode & SLA
                                 }                                  }
                                 goto shortcut;                                  goto shortcut;
                         }                          }
                   } else {
                           /* consumer doesn't have the right number of CSNs */
                           changed = SS_CHANGED;
                 }                  }
                 /* Do we have a sessionlog for this search? */                  /* Do we have a sessionlog for this search? */
                 sl=si->si_logs;                  sl=si->si_logs;
Line 2388  syncprov_operational( Line 2395  syncprov_operational(
                                 }                                  }
   
                                 if ( !ap ) {                                  if ( !ap ) {
                                         if ( !rs->sr_flags & REP_ENTRY_MODIFIABLE ) {                                          if ( !(rs->sr_flags & REP_ENTRY_MODIFIABLE) ) {
                                                 rs->sr_entry = entry_dup( rs->sr_entry );                                                  rs->sr_entry = entry_dup( rs->sr_entry );
                                                 rs->sr_flags |=                                                  rs->sr_flags |=
                                                         REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;                                                          REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;

Removed from v.1.223  
changed lines
  Added in v.1.230


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org