]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/daemon.c
More for prev commit
[openldap] / servers / slapd / daemon.c
index c82260eba88bcfbf78c1489b66facdb34f59a567..fe87e196a4629a031e221c75bf981834214175eb 100644 (file)
@@ -215,7 +215,7 @@ static struct slap_daemon {
        int rc; \
        SLAP_EPOLL_SOCK_IX((s)) = slap_daemon.sd_nfds; \
        SLAP_EPOLL_SOCK_EP((s)).data.ptr = (l) ? (l) : (void *)(&SLAP_EPOLL_SOCK_IX(s)); \
-       SLAP_EPOLL_SOCK_EV((s)) = EPOLLIN|EPOLLET; \
+       SLAP_EPOLL_SOCK_EV((s)) = EPOLLIN; \
        rc = epoll_ctl(slap_daemon.sd_epfd, EPOLL_CTL_ADD, \
                (s), &SLAP_EPOLL_SOCK_EP((s))); \
        if ( rc == 0 ) { \
@@ -2545,7 +2545,14 @@ slapd_daemon_task(
                                } else if ( !w ) {
                                        Debug( LDAP_DEBUG_CONNS,
                                                "daemon: hangup on %d\n", fd, 0, 0 );
-                                       connection_hangup( fd );
+                                       if ( SLAP_SOCK_IS_ACTIVE( fd )) {
+#ifdef HAVE_EPOLL
+                                               /* Don't keep reporting the hangup
+                                                */
+                                               SLAP_EPOLL_SOCK_SET( fd, EPOLLET );
+#endif
+                                               connection_hangup( fd );
+                                       }
                                }
                        }
                }