From 9b8dd2033ff5d20578d093cccdf14314abc3f762 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 16 Jan 2009 21:49:00 +0000 Subject: [PATCH] Revert prev commit, better fix - make sure client conns are closed as expected --- servers/slapd/connection.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index c11c67e648..ae6416f5eb 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1185,8 +1185,6 @@ void connection_client_stop( /* get (locked) connection */ c = connection_get( s ); - if ( !c ) return; - assert( c->c_conn_state == SLAP_C_CLIENT ); c->c_listener = NULL; @@ -1265,9 +1263,14 @@ connection_hangup( ber_socket_t s ) 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 ); + } } } -- 2.39.5