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

version 1.98, 2005/08/15 05:18:19 version 1.99, 2005/08/23 01:25:21
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.97 2005/08/15 03:36:56 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.98 2005/08/15 05:18:19 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  sp_cf_gen(ConfigArgs *c) Line 2114  sp_cf_gen(ConfigArgs *c)
 /* Cheating - we have no thread pool context for these functions,  /* Cheating - we have no thread pool context for these functions,
  * so make one.   * so make one.
  */   */
 typedef struct thread_keys {  
         void *key;  static void *syncprov_thrctx;
         void *data;  
         ldap_pvt_thread_pool_keyfree_t *xfree;  
 } thread_keys;  
   
 #define MAXKEYS 32  
 /* A fake thread context */  
 static thread_keys thrctx[MAXKEYS];  
   
 /* 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 2165  syncprov_db_open( Line 2158  syncprov_db_open(
                 return rc;                  return rc;
         }          }
   
         connection_fake_init( &conn, op, thrctx );          syncprov_thrctx = ldap_pvt_thread_pool_fake_context_init();
           connection_fake_init( &conn, op, syncprov_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 2241  syncprov_db_close( Line 2235  syncprov_db_close(
                 Operation *op = (Operation *)opbuf;                  Operation *op = (Operation *)opbuf;
                 SlapReply rs = {REP_RESULT};                  SlapReply rs = {REP_RESULT};
   
                 connection_fake_init( &conn, op, thrctx );                  connection_fake_init( &conn, op, syncprov_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 );
         }          }
         for ( i=0; thrctx[i].key; i++) {          ldap_pvt_thread_pool_fake_context_destroy( syncprov_thrctx );
                 if ( thrctx[i].xfree )          syncprov_thrctx = NULL;
                         thrctx[i].xfree( thrctx[i].key, thrctx[i].data );  
                 thrctx[i].key = NULL;  
         }  
   
     return 0;      return 0;
 }  }

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


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