From: Kurt Zeilenga Date: Fri, 8 Sep 2000 18:46:18 +0000 (+0000) Subject: Minor change to connection error handling X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2066 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c342e894cbda35c34595c1848f1e7924f06a785;p=openldap Minor change to connection error handling --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 60e846a7a6..e41e239d31 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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;