]> git.sur5r.net Git - openldap/commitdiff
Revert prev commit, better fix - make sure client conns are closed
authorHoward Chu <hyc@openldap.org>
Fri, 16 Jan 2009 21:49:00 +0000 (21:49 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 16 Jan 2009 21:49:00 +0000 (21:49 +0000)
as expected

servers/slapd/connection.c

index c11c67e6485b54755ec9d8258098cb5b9d428e3d..ae6416f5eb4158a7c91933c104e42afc32e7c561 100644 (file)
@@ -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 );
+               }
        }
 }