/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/* get (locked) connection */
c = connection_get( s );
-
+
assert( c->c_conn_state == SLAP_C_CLIENT );
c->c_listener = NULL;
c = connection_get( s );
if ( c ) {
- connection_closing( c, "connection lost" );
- connection_close( c );
- connection_return( c );
+ if ( c->c_conn_state == SLAP_C_CLIENT ) {
+ connection_return( c );
+ connection_read_activate( s );
+ } else {
+ connection_closing( c, "connection lost" );
+ connection_close( c );
+ connection_return( c );
+ }
}
}
Debug( LDAP_DEBUG_TRACE,
"connection_write(%d): waking output for id=%lu\n",
s, c->c_connid, 0 );
+ ldap_pvt_thread_mutex_lock( &c->c_write2_mutex );
ldap_pvt_thread_cond_signal( &c->c_write2_cv );
+ ldap_pvt_thread_mutex_unlock( &c->c_write2_mutex );
if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) ) {
slapd_set_read( s, 1 );