]> git.sur5r.net Git - openldap/commitdiff
ITS#6548,#7092 don't pass hangup events to reader thread
authorHoward Chu <hyc@openldap.org>
Sat, 19 Nov 2011 21:57:56 +0000 (13:57 -0800)
committerHoward Chu <hyc@openldap.org>
Sat, 19 Nov 2011 21:57:56 +0000 (13:57 -0800)
servers/slapd/daemon.c

index 277ae934cadb0aab6cc72c58831235a43f0e77e8..0c25bb8d905d7bd049d6a950657deb814514a621 100644 (file)
@@ -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
                                }
                        }
                }