}
tavl_delete( &client->c_ops, op, operation_client_cmp );
+ client->c_n_ops_executing--;
client_reset( client );
rc = tavl_insert( &client->c_ops, op, operation_client_cmp, avl_dup_error );
assert( rc == LDAP_SUCCESS );
+ client->c_n_ops_executing++;
CONNECTION_UNLOCK(client);
if ( pin ) {
assert( !removed || op == removed );
if ( client->c_state == LLOAD_C_BINDING ) {
+ assert( removed );
switch ( result ) {
case LDAP_SASL_BIND_IN_PROGRESS:
op->o_saved_msgid = op->o_client_msgid;
client->c_state = LLOAD_C_READY;
client->c_type = LLOAD_C_OPEN;
client->c_pin_id = 0;
+ client->c_n_ops_executing--;
if ( !BER_BVISNULL( &client->c_auth ) ) {
if ( result != LDAP_SUCCESS ) {
ber_memfree( client->c_auth.bv_val );
}
}
} else {
+ if ( removed ) {
+ client->c_n_ops_executing--;
+ }
assert( client->c_state == LLOAD_C_DYING ||
client->c_state == LLOAD_C_CLOSING );
}
removed = tavl_delete( &client->c_ops, op, operation_client_cmp );
assert( !removed || op == removed );
op->o_pin_id = 0;
+ if ( removed ) {
+ client->c_n_ops_executing--;
+ }
Debug( LDAP_DEBUG_TRACE, "handle_whoami_response: "
"connid=%ld new authid=%s\n",
client_reset( LloadConnection *c )
{
TAvlnode *root;
+ long freed = 0, executing;
root = c->c_ops;
c->c_ops = NULL;
+ executing = c->c_n_ops_executing;
+ c->c_n_ops_executing = 0;
if ( !BER_BVISNULL( &c->c_auth ) ) {
ch_free( c->c_auth.bv_val );
CONNECTION_UNLOCK(c);
if ( root ) {
- int freed;
freed = tavl_free( root, (AVL_FREE)operation_abandon );
Debug( LDAP_DEBUG_TRACE, "client_reset: "
- "dropped %d operations\n",
+ "dropped %ld operations\n",
freed );
}
+ assert( freed == executing );
CONNECTION_LOCK(c);
}
handle_starttls( LloadConnection *c, LloadOperation *op )
{
struct event_base *base = event_get_base( c->c_read_event );
+ LloadOperation *found;
BerElement *output;
char *msg = NULL;
int rc = LDAP_SUCCESS;
CONNECTION_LOCK(c);
- tavl_delete( &c->c_ops, op, operation_client_cmp );
+ found = tavl_delete( &c->c_ops, op, operation_client_cmp );
+ assert( op == found );
+ c->c_n_ops_executing--;
if ( c->c_is_tls == LLOAD_TLS_ESTABLISHED ) {
rc = LDAP_OPERATIONS_ERROR;