]> git.sur5r.net Git - openldap/commitdiff
Minor change to connection error handling
authorKurt Zeilenga <kurt@openldap.org>
Fri, 8 Sep 2000 18:46:18 +0000 (18:46 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 8 Sep 2000 18:46:18 +0000 (18:46 +0000)
servers/slapd/connection.c

index 60e846a7a647a22c4fb2aeecf9818f3021fdf62b..e41e239d319b62ba1773ce2fb2c4f26e80969285 100644 (file)
@@ -991,12 +991,19 @@ int connection_read(ber_socket_t s)
                /* connections_mutex and c_mutex are locked */
                connection_closing( c );
                connection_close( c );
+               connection_return( c );
+               ldap_pvt_thread_mutex_unlock( &connections_mutex );
+               return 0;
        }
 
-       if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) )
+       if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) ) {
                slapd_set_read( s, 1 );
-       if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_WRITE, NULL ) )
+       }
+
+       if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_WRITE, NULL ) ) {
                slapd_set_write( s, 1 );
+       }
+
        connection_return( c );
        ldap_pvt_thread_mutex_unlock( &connections_mutex );
        return 0;