From 42a7fcf19a91193a3228ab00d984e3f069ec4c02 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 19 Nov 2011 13:57:56 -0800 Subject: [PATCH] ITS#6548,#7092 don't pass hangup events to reader thread --- servers/slapd/daemon.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 277ae934ca..0c25bb8d90 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -2784,25 +2784,22 @@ loop: } } /* If event is a read */ - if ( SLAP_EVENT_IS_READ( i )) + if ( SLAP_EVENT_IS_READ( i )) { r = 1; - if ( r || !w ) { Debug( LDAP_DEBUG_CONNS, "daemon: read active on %d\n", fd, 0, 0 ); - if ( r ) { - SLAP_EVENT_CLR_READ( i ); - } else { + SLAP_EVENT_CLR_READ( i ); + connection_read_activate( fd ); + } else if ( !w ) { #ifdef HAVE_EPOLL - /* Don't keep reporting the hangup - */ - if ( SLAP_SOCK_IS_ACTIVE( tid, fd )) { - SLAP_EPOLL_SOCK_SET( tid, fd, EPOLLET ); - } -#endif + /* Don't keep reporting the hangup + */ + if ( SLAP_SOCK_IS_ACTIVE( tid, fd )) { + SLAP_EPOLL_SOCK_SET( tid, fd, EPOLLET ); } - connection_read_activate( fd ); +#endif } } } -- 2.39.5