-/*
- * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * 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>
*
* This work has been developed to fulfill the requirements
struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1;
struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2;
- int d = cc1->dn.bv_len - cc2->dn.bv_len;
-
/*
* case sensitive, because the dn MUST be normalized
*/
- return d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val );
+ return ber_bvcmp( &cc1->dn, &cc2->dn);
}
/*
struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1;
struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2;
- int d = cc1->dn.bv_len - cc2->dn.bv_len;
- int cmp;
-
/*
* case sensitive, because the dn MUST be normalized
*/
- cmp = d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val );
-
- return ( cmp == 0 ) ? -1 : 0;
+ return ( ber_bvcmp( &cc1->dn, &cc2->dn ) == 0 ) ? -1 : 0;
}
/*
ldap_pvt_thread_mutex_lock( &cache->mutex );
entry = avl_delete( &cache->tree, ( caddr_t )&tmp_entry,
meta_dncache_cmp );
- ldap_pvt_thread_mutex_lock( &cache->mutex );
+ ldap_pvt_thread_mutex_unlock( &cache->mutex );
if ( entry != NULL ) {
meta_dncache_free( ( void * )entry );