Diff for /servers/slapd/overlays/syncprov.c between versions 1.86 and 1.87

version 1.86, 2005/06/30 01:42:51 version 1.87, 2005/06/30 02:06:40
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.85 2005/06/04 07:44:39 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.86 2005/06/30 01:42:51 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 2114  typedef struct thread_keys { Line 2114  typedef struct thread_keys {
 /* A fake thread context */  /* A fake thread context */
 static thread_keys thrctx[MAXKEYS];  static thread_keys thrctx[MAXKEYS];
   
   /* ITS#3456 we cannot run this search on the main thread, must use a
    * child thread in order to insure we have a big enough stack.
    */
   static void *
   syncprov_db_otask(
           void *ptr
   )
   {
           syncprov_findcsn( ptr, FIND_MAXCSN );
           return NULL;
   }
   
 /* Read any existing contextCSN from the underlying db.  /* Read any existing contextCSN from the underlying db.
  * Then search for any entries newer than that. If no value exists,   * Then search for any entries newer than that. If no value exists,
  * just generate it. Cache whatever result.   * just generate it. Cache whatever result.
Line 2155  syncprov_db_open( Line 2167  syncprov_db_open(
                 slap_schema.si_ad_contextCSN, 0, &e );                  slap_schema.si_ad_contextCSN, 0, &e );
   
         if ( e ) {          if ( e ) {
                   ldap_pvt_thread_t tid;
   
                 a = attr_find( e->e_attrs, slap_schema.si_ad_contextCSN );                  a = attr_find( e->e_attrs, slap_schema.si_ad_contextCSN );
                 if ( a ) {                  if ( a ) {
                         si->si_ctxcsn.bv_len = a->a_nvals[0].bv_len;                          si->si_ctxcsn.bv_len = a->a_nvals[0].bv_len;
Line 2166  syncprov_db_open( Line 2180  syncprov_db_open(
                         strcpy( ctxcsnbuf, si->si_ctxcsnbuf );                          strcpy( ctxcsnbuf, si->si_ctxcsnbuf );
                 }                  }
                 be_entry_release_rw( op, e, 0 );                  be_entry_release_rw( op, e, 0 );
 #if 0   /* ITS#3456, can't check this here. I think we're fine without it. */  
                 op->o_bd->bd_info = (BackendInfo *)on;                  op->o_bd->bd_info = (BackendInfo *)on;
                 op->o_req_dn = be->be_suffix[0];                  op->o_req_dn = be->be_suffix[0];
                 op->o_req_ndn = be->be_nsuffix[0];                  op->o_req_ndn = be->be_nsuffix[0];
                 op->ors_scope = LDAP_SCOPE_SUBTREE;                  op->ors_scope = LDAP_SCOPE_SUBTREE;
                 syncprov_findcsn( op, FIND_MAXCSN );                  ldap_pvt_thread_create( &tid, 0, syncprov_db_otask, op );
 #endif                  ldap_pvt_thread_join( tid, NULL );
         } else if ( SLAP_SYNC_SHADOW( op->o_bd )) {          } else if ( SLAP_SYNC_SHADOW( op->o_bd )) {
                 /* If we're also a consumer, and we didn't find the context entry,                  /* If we're also a consumer, and we didn't find the context entry,
                  * then don't generate anything, wait for our provider to send it                   * then don't generate anything, wait for our provider to send it

Removed from v.1.86  
changed lines
  Added in v.1.87


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