Diff for /servers/slapd/back-meta/init.c between versions 1.20 and 1.20.2.3

version 1.20, 2003/05/24 15:38:04 version 1.20.2.3, 2003/12/01 00:58:41
Line 1 Line 1
 /*  /* $OpenLDAP$ */
  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file   *
    * Copyright 1999-2003 The OpenLDAP Foundation.
    * All rights reserved.
  *   *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted only as authorized by the OpenLDAP
    * Public License.
    *
    * A copy of this license is available in the file LICENSE in the
    * top-level directory of the distribution or, alternatively, at
    * <http://www.OpenLDAP.org/license.html>.
    */
   /* ACKNOWLEDGEMENTS:
    * This work was initially developed by the Howard Chu for inclusion
    * in OpenLDAP Software and subsequently enhanced by Pierangelo
    * Masarati.
    */
   /* This is an altered version */
   /*
  * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>   * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
  *   *
  * This work has been developed to fulfill the requirements   * This work has been developed to fulfill the requirements
Line 78 Line 95
 #ifdef SLAPD_META_DYNAMIC  #ifdef SLAPD_META_DYNAMIC
   
 int  int
 back_meta_LTX_init_module( int argc, char *argv[] ) {  init_module( int argc, char *argv[] ) {
     BackendInfo bi;      BackendInfo bi;
   
     memset( &bi, '\0', sizeof( bi ) );      memset( &bi, '\0', sizeof( bi ) );
Line 136  meta_back_db_init( Line 153  meta_back_db_init(
 {  {
         struct metainfo *li;          struct metainfo *li;
   
 #ifdef LDAP_CACHING  
         struct rewrite_info     *rwinfo;          struct rewrite_info     *rwinfo;
         cache_manager           *cm;          cache_manager           *cm;
         query_manager           *qm;          query_manager           *qm;
Line 148  meta_back_db_init( Line 164  meta_back_db_init(
                                   
         cm = (cache_manager *)ch_malloc(sizeof(cache_manager));           cm = (cache_manager *)ch_malloc(sizeof(cache_manager)); 
         if ( cm == NULL ) {          if ( cm == NULL ) {
                 rewrite_info_delete( rwinfo );                  rewrite_info_delete( &rwinfo );
                 return -1;                  return -1;
         }          }
   
         qm = (query_manager*)ch_malloc(sizeof(query_manager));           qm = (query_manager*)ch_malloc(sizeof(query_manager)); 
         if ( qm == NULL ) {          if ( qm == NULL ) {
                 rewrite_info_delete( rwinfo );                  rewrite_info_delete( &rwinfo );
                 ch_free( cm );                  ch_free( cm );
                 return -1;                  return -1;
         }          }
   
         cm->caching = 0;           cm->caching = 0; 
         cm->qm = qm;           cm->qm = qm; 
         cm->numattrsets = 0;           cm->numattrsets = 0; 
         cm->numtemplates = 0;             cm->numtemplates = 0;   
         cm->num_entries_limit = 5;          cm->num_entries_limit = 5;
         cm->cache_size = 0;          cm->cache_size = 0;
         cm->thresh_hi = 500000;          cm->thresh_hi = 500000;
         cm->thresh_lo = 700000;          cm->thresh_lo = 700000;
Line 182  meta_back_db_init( Line 198  meta_back_db_init(
         qm->qcfunc = query_containment;           qm->qcfunc = query_containment; 
         qm->crfunc = cache_replacement;           qm->crfunc = cache_replacement; 
         qm->addfunc = add_query;           qm->addfunc = add_query; 
         ldap_pvt_thread_mutex_init(&qm->lru_mutex);           ldap_pvt_thread_mutex_init(&qm->lru_mutex); 
                   
         ldap_pvt_thread_mutex_init(&cm->cache_mutex);           ldap_pvt_thread_mutex_init(&cm->cache_mutex); 
         ldap_pvt_thread_mutex_init(&cm->remove_mutex);           ldap_pvt_thread_mutex_init(&cm->remove_mutex); 
         ldap_pvt_thread_mutex_init( &cm->cc_mutex );          ldap_pvt_thread_mutex_init( &cm->cc_mutex );
 #endif /* LDAP_CACHING */  
   
         li = ch_calloc( 1, sizeof( struct metainfo ) );          li = ch_calloc( 1, sizeof( struct metainfo ) );
         if ( li == NULL ) {          if ( li == NULL ) {
Line 199  meta_back_db_init( Line 214  meta_back_db_init(
          * this may change           * this may change
          */           */
         li->defaulttarget = META_DEFAULT_TARGET_NONE;          li->defaulttarget = META_DEFAULT_TARGET_NONE;
 #ifdef LDAP_CACHING  
         li->cm = cm;           li->cm = cm; 
         li->rwinfo = rwinfo;          li->rwinfo = rwinfo;
         /* FIXME: what about qm ? */          /* FIXME: what about qm ? */
 #endif /* LDAP_CACHING */  
   
         ldap_pvt_thread_mutex_init( &li->conn_mutex );          ldap_pvt_thread_mutex_init( &li->conn_mutex );
         ldap_pvt_thread_mutex_init( &li->cache.mutex );          ldap_pvt_thread_mutex_init( &li->cache.mutex );
Line 263  target_free( Line 276  target_free(
                 free( lt->pseudorootpw.bv_val );                  free( lt->pseudorootpw.bv_val );
         }          }
         if ( lt->rwmap.rwm_rw ) {          if ( lt->rwmap.rwm_rw ) {
                 rewrite_info_delete( lt->rwmap.rwm_rw );                  rewrite_info_delete( &lt->rwmap.rwm_rw );
         }          }
         avl_free( lt->rwmap.rwm_oc.remap, NULL );          avl_free( lt->rwmap.rwm_oc.remap, NULL );
         avl_free( lt->rwmap.rwm_oc.map, mapping_free );          avl_free( lt->rwmap.rwm_oc.map, mapping_free );

Removed from v.1.20  
changed lines
  Added in v.1.20.2.3


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