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

version 1.16, 2002/03/26 17:01:58 version 1.17, 2002/04/05 03:59:04
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 2002/01/04 20:17:49 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/dbcache.c,v 1.16 2002/03/26 17:01:58 julius 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 30  bdb_db_hash( Line 29  bdb_db_hash(
         u_int32_t length          u_int32_t length
 )  )
 {  {
         u_int32_t *ret = (u_int32_t *)bytes;          u_int32_t ret = 0;
         return *ret;          unsigned char *dst = (unsigned char *)&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 90  bdb_db_cache( Line 98  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 );

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


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