mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
ITS#5886 fix epoll hangup handling
This commit is contained in:
parent
f54bb377df
commit
96192064f3
@ -1249,6 +1249,20 @@ int connection_read_activate( ber_socket_t s )
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Used for epoll / event functions that distinguish hangups from read events */
|
||||
void
|
||||
connection_hangup( ber_socket_t s )
|
||||
{
|
||||
Connection *c;
|
||||
|
||||
c = connection_get( s );
|
||||
if ( c ) {
|
||||
connection_closing( c, "connection lost" );
|
||||
connection_close( c );
|
||||
connection_return( c );
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
connection_read( ber_socket_t s, conn_readinfo *cri )
|
||||
{
|
||||
|
@ -2544,6 +2544,7 @@ slapd_daemon_task(
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_CONNS,
|
||||
"daemon: hangup on %d\n", fd, 0, 0 );
|
||||
connection_hangup( fd );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -745,6 +745,7 @@ LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
|
||||
|
||||
LDAP_SLAPD_F (void) connection_closing LDAP_P((
|
||||
Connection *c, const char *why ));
|
||||
LDAP_SLAPD_F (void) connection_hangup LDAP_P(( ber_socket_t fd ));
|
||||
LDAP_SLAPD_F (int) connection_state_closing LDAP_P(( Connection *c ));
|
||||
LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
|
||||
LDAP_GCCATTR((const));
|
||||
|
Loading…
Reference in New Issue
Block a user