]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/trans.c
use slab memory for proxyauthz
[openldap] / servers / slapd / back-bdb / trans.c
index 51fecf418b78f8c9ff79352036a803a0242b7e03..115fcbd8aa62e1a5be4601d65b86ed51483687ac 100644 (file)
@@ -1,5 +1,18 @@
 /* trans.c - bdb backend transaction routines */
 /* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2000-2006 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>.
+ */
 
 #include "portable.h"
 
@@ -7,8 +20,8 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 #include "lber_pvt.h"
+#include "lutil.h"
 
 
 /* Congestion avoidance code
@@ -25,7 +38,7 @@ bdb_trans_backoff( int num_retries )
        unsigned long max_key = -1;
        struct timeval timeout;
 
-       lutil_entropy( &key, sizeof( unsigned long ));
+       lutil_entropy( (unsigned char *) &key, sizeof( unsigned long ));
 
        for ( i = 0; i < num_retries; i++ ) {
                if ( i >= 5 ) break;
@@ -35,11 +48,7 @@ bdb_trans_backoff( int num_retries )
        delay = 16384 * (key * (double) pow_retries / (double) max_key);
        delay = delay ? delay : 1;
 
-#ifdef NEW_LOGGING
-       LDAP_LOG( OPERATION, ERR, "delay = %d, num_retries = %d\n", delay, num_retries, 0 );
-#else
        Debug( LDAP_DEBUG_TRACE,  "delay = %d, num_retries = %d\n", delay, num_retries, 0 );
-#endif
 
        timeout.tv_sec = delay / 1000000;
        timeout.tv_usec = delay % 1000000;