mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 01:29:59 -05:00
Stop the read callback on a dead connection.
The connection might be ready to read (close) but if we can't destroy it yet, we don't want the callback to trigger all the time or process new data.
This commit is contained in:
parent
6899d0123d
commit
8eb7f3fbca
2 changed files with 14 additions and 0 deletions
|
|
@ -35,6 +35,11 @@ client_read_cb( evutil_socket_t s, short what, void *arg )
|
|||
ber_len_t len;
|
||||
|
||||
CONNECTION_LOCK(c);
|
||||
if ( !c->c_live ) {
|
||||
event_del( c->c_read_event );
|
||||
CONNECTION_UNLOCK(c);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
|
||||
"connection %lu ready to read\n",
|
||||
|
|
@ -61,6 +66,8 @@ client_read_cb( evutil_socket_t s, short what, void *arg )
|
|||
|
||||
c->c_currentber = NULL;
|
||||
ber_free( ber, 1 );
|
||||
|
||||
event_del( c->c_read_event );
|
||||
CLIENT_DESTROY(c);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -488,6 +488,11 @@ upstream_read_cb( evutil_socket_t s, short what, void *arg )
|
|||
ber_len_t len;
|
||||
|
||||
CONNECTION_LOCK(c);
|
||||
if ( !c->c_live ) {
|
||||
event_del( c->c_read_event );
|
||||
CONNECTION_UNLOCK(c);
|
||||
return;
|
||||
}
|
||||
Debug( LDAP_DEBUG_CONNS, "upstream_read_cb: "
|
||||
"connection %lu ready to read\n",
|
||||
c->c_connid );
|
||||
|
|
@ -513,6 +518,8 @@ upstream_read_cb( evutil_socket_t s, short what, void *arg )
|
|||
|
||||
c->c_currentber = NULL;
|
||||
ber_free( ber, 1 );
|
||||
|
||||
event_del( c->c_read_event );
|
||||
UPSTREAM_DESTROY(c);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue