Diff for /servers/slapd/back-bdb/dbcache.c between versions 1.15.2.2 and 1.16

version 1.15.2.2, 2002/07/28 19:16:57 version 1.16, 2002/03/26 17:01:58
Line 1 Line 1
 /* dbcache.c - manage cache of open databases */  /* dbcache.c - manage cache of open databases */
 /* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/dbcache.c,v 1.15.2.1 2002/04/15 15:21:58 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/dbcache.c,v 1.15 2002/01/04 20:17:49 kurt Exp $ */
 /*  /*
  * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.   * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file   * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
Line 22 Line 22
 /* Pass-thru hash function. Since the indexer is already giving us hash  /* Pass-thru hash function. Since the indexer is already giving us hash
  * values as keys, we don't need BDB to re-hash them.   * values as keys, we don't need BDB to re-hash them.
  */   */
   #if LUTIL_HASH_BYTES == 4
 static u_int32_t  static u_int32_t
 bdb_db_hash(  bdb_db_hash(
         DB *db,          DB *db,
Line 29  bdb_db_hash( Line 30  bdb_db_hash(
         u_int32_t length          u_int32_t length
 )  )
 {  {
         u_int32_t ret = 0;          u_int32_t *ret = (u_int32_t *)bytes;
         unsigned char *dst = (unsigned char *)&ret;          return *ret;
         const unsigned char *src = (const unsigned char *)bytes;  
   
         if ( length > sizeof(u_int32_t) )  
                 length = sizeof(u_int32_t);  
   
         while ( length ) {  
                 *dst++ = *src++;  
                 length--;  
         }  
         return ret;  
 }  }
   #endif
   
 int  int
 bdb_db_cache(  bdb_db_cache(
Line 87  bdb_db_cache( Line 79  bdb_db_cache(
         rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );          rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );
         if( rc != 0 ) {          if( rc != 0 ) {
 #ifdef NEW_LOGGING  #ifdef NEW_LOGGING
                 LDAP_LOG ( CACHE, ERR,                   LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ));
                         "bdb_db_cache: db_create(%s) failed: %s (%d)\n",   
                         bdb->bi_dbenv_home, db_strerror(rc), rc );  
 #else  #else
                 Debug( LDAP_DEBUG_ANY,                  Debug( LDAP_DEBUG_ANY,
                         "bdb_db_cache: db_create(%s) failed: %s (%d)\n",                          "bdb_db_cache: db_create(%s) failed: %s (%d)\n",
Line 100  bdb_db_cache( Line 90  bdb_db_cache(
         }          }
   
         rc = db->bdi_db->set_pagesize( db->bdi_db, BDB_PAGESIZE );          rc = db->bdi_db->set_pagesize( db->bdi_db, BDB_PAGESIZE );
   #if LUTIL_HASH_BYTES == 4
         rc = db->bdi_db->set_h_hash( db->bdi_db, bdb_db_hash );          rc = db->bdi_db->set_h_hash( db->bdi_db, bdb_db_hash );
   #endif
 #ifdef BDB_IDL_MULTI  #ifdef BDB_IDL_MULTI
         rc = db->bdi_db->set_flags( db->bdi_db, DB_DUP | DB_DUPSORT );          rc = db->bdi_db->set_flags( db->bdi_db, DB_DUP | DB_DUPSORT );
         rc = db->bdi_db->set_dup_compare( db->bdi_db, bdb_bt_compare );          rc = db->bdi_db->set_dup_compare( db->bdi_db, bdb_bt_compare );
Line 118  bdb_db_cache( Line 110  bdb_db_cache(
   
         if( rc != 0 ) {          if( rc != 0 ) {
 #ifdef NEW_LOGGING  #ifdef NEW_LOGGING
                 LDAP_LOG ( CACHE, ERR,                   LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", name, db_strerror(rc), rc ));
                         "bdb_db_cache: db_open(%s) failed: %s (%d)\n",   
                         name, db_strerror(rc), rc );  
 #else  #else
                 Debug( LDAP_DEBUG_ANY,                  Debug( LDAP_DEBUG_ANY,
                         "bdb_db_cache: db_open(%s) failed: %s (%d)\n",                          "bdb_db_cache: db_open(%s) failed: %s (%d)\n",

Removed from v.1.15.2.2  
changed lines
  Added in v.1.16


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