Diff for /servers/slapd/overlays/syncprov.c between versions 1.99 and 1.100

version 1.99, 2005/08/23 01:25:21 version 1.100, 2005/08/23 02:12:57
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.98 2005/08/15 05:18:19 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.99 2005/08/23 01:25:21 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 2111  sp_cf_gen(ConfigArgs *c) Line 2111  sp_cf_gen(ConfigArgs *c)
         return rc;          return rc;
 }  }
   
 /* Cheating - we have no thread pool context for these functions,  
  * so make one.  
  */  
   
 static void *syncprov_thrctx;  
   
 /* ITS#3456 we cannot run this search on the main thread, must use a  /* 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.   * child thread in order to insure we have a big enough stack.
  */   */
Line 2148  syncprov_db_open( Line 2142  syncprov_db_open(
         Entry *e;          Entry *e;
         Attribute *a;          Attribute *a;
         int rc;          int rc;
           void *thrctx = NULL;
   
         if ( slapMode & SLAP_TOOL_MODE ) {          if ( slapMode & SLAP_TOOL_MODE ) {
                 return 0;                  return 0;
Line 2158  syncprov_db_open( Line 2153  syncprov_db_open(
                 return rc;                  return rc;
         }          }
   
         syncprov_thrctx = ldap_pvt_thread_pool_fake_context_init();          thrctx = ldap_pvt_thread_pool_context();
         connection_fake_init( &conn, op, syncprov_thrctx );          connection_fake_init( &conn, op, thrctx );
         op->o_bd = be;          op->o_bd = be;
         op->o_dn = be->be_rootdn;          op->o_dn = be->be_rootdn;
         op->o_ndn = be->be_rootndn;          op->o_ndn = be->be_rootndn;
Line 2212  syncprov_db_open( Line 2207  syncprov_db_open(
   
 out:  out:
         op->o_bd->bd_info = (BackendInfo *)on;          op->o_bd->bd_info = (BackendInfo *)on;
           ldap_pvt_thread_pool_context_reset( thrctx );
         return 0;          return 0;
 }  }
   
Line 2234  syncprov_db_close( Line 2230  syncprov_db_close(
                 char opbuf[OPERATION_BUFFER_SIZE];                  char opbuf[OPERATION_BUFFER_SIZE];
                 Operation *op = (Operation *)opbuf;                  Operation *op = (Operation *)opbuf;
                 SlapReply rs = {REP_RESULT};                  SlapReply rs = {REP_RESULT};
                   void *thrctx;
   
                 connection_fake_init( &conn, op, syncprov_thrctx );                  thrctx = ldap_pvt_thread_pool_context();
                   connection_fake_init( &conn, op, thrctx );
                 op->o_bd = be;                  op->o_bd = be;
                 op->o_dn = be->be_rootdn;                  op->o_dn = be->be_rootdn;
                 op->o_ndn = be->be_rootndn;                  op->o_ndn = be->be_rootndn;
                 syncprov_checkpoint( op, &rs, on );                  syncprov_checkpoint( op, &rs, on );
                   ldap_pvt_thread_pool_context_reset( thrctx );
         }          }
         ldap_pvt_thread_pool_fake_context_destroy( syncprov_thrctx );  
         syncprov_thrctx = NULL;  
   
     return 0;      return 0;
 }  }

Removed from v.1.99  
changed lines
  Added in v.1.100


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