]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#4395, check for non-read/write epoll events
authorHoward Chu <hyc@openldap.org>
Fri, 10 Feb 2006 18:27:50 +0000 (18:27 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 10 Feb 2006 18:27:50 +0000 (18:27 +0000)
servers/slapd/daemon.c

index 01afde3584a627ca43555ba44ee399911f7e5fc9..b1724ed3a140502547e7dcbdbf4582746a85e33b 100644 (file)
@@ -2071,7 +2071,7 @@ slapd_daemon_task(
 #endif
 
                for (i=0; i<ns; i++) {
-                       int rc = 1, fd;
+                       int rc = 1, fd, waswrite = 0;
 
                        if ( SLAP_EVENT_IS_LISTENER(i) ) {
 #ifdef SLAP_LIGHTWEIGHT_DISPATCHER
@@ -2101,6 +2101,8 @@ slapd_daemon_task(
                                                "daemon: write active on %d\n",
                                                fd, 0, 0 );
 
+                                       waswrite = 1;
+
 #ifdef SLAP_LIGHTWEIGHT_DISPATCHER
                                        connection_write_activate( fd );
 #else
@@ -2115,7 +2117,8 @@ slapd_daemon_task(
                                        }
 #endif
                                }
-                               if( SLAP_EVENT_IS_READ( i ) ) {
+                               /* If event is a read or an error */
+                               if( SLAP_EVENT_IS_READ( i ) || !waswrite ) {
                                        Debug( LDAP_DEBUG_CONNS,
                                                "daemon: read active on %d\n",
                                                fd, 0, 0 );