/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
slap_counters_t *sc;
void *vsc = NULL;
- if ( ldap_pvt_thread_pool_getkey( ctx, conn_counter_init, &vsc, NULL ) || !vsc ) {
+ if ( ldap_pvt_thread_pool_getkey(
+ ctx, (void *)conn_counter_init, &vsc, NULL ) || !vsc ) {
vsc = ch_malloc( sizeof( slap_counters_t ));
sc = vsc;
slap_counters_init( sc );
- ldap_pvt_thread_pool_setkey( ctx, conn_counter_init, vsc,
+ ldap_pvt_thread_pool_setkey( ctx, (void*)conn_counter_init, vsc,
conn_counter_destroy, NULL, NULL );
ldap_pvt_thread_mutex_lock( &slap_counters.sc_mutex );
{
Operation *op;
+ if( conn->c_writewaiter )
+ return 0;
+
if( conn->c_conn_state == SLAP_C_CLOSING ) {
Debug( LDAP_DEBUG_TRACE, "connection_resched: "
"attempting closing conn=%lu sd=%d\n",
return 0;
}
- if( conn->c_conn_state != SLAP_C_ACTIVE || conn->c_writewaiter ) {
+ if( conn->c_conn_state != SLAP_C_ACTIVE ) {
/* other states need different handling */
return 0;
}
void *ebx = NULL;
/* Use thread keys to make sure these eventually get cleaned up */
- if ( ldap_pvt_thread_pool_getkey( ctx, connection_fake_init, &ebx,
- NULL )) {
+ if ( ldap_pvt_thread_pool_getkey( ctx, (void *)connection_fake_init,
+ &ebx, NULL )) {
eb = ch_malloc( sizeof( *eb ));
slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, conn );
slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op );
eb->eb_conn = conn->c_extensions;
eb->eb_op = op->o_hdr->oh_extensions;
- ldap_pvt_thread_pool_setkey( ctx, connection_fake_init,
+ ldap_pvt_thread_pool_setkey( ctx, (void *)connection_fake_init,
eb, connection_fake_destroy, NULL, NULL );
} else {
eb = ebx;