]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit, was hanging up on write events
authorHoward Chu <hyc@openldap.org>
Fri, 16 Jan 2009 22:32:21 +0000 (22:32 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 16 Jan 2009 22:32:21 +0000 (22:32 +0000)
servers/slapd/daemon.c

index 0c12c1a3ef47d4b9b60c36eb990857b78a8a2ed8..7f953e4d329abe40b4d3f6ed0e04da5a9d590839 100644 (file)
@@ -2495,7 +2495,7 @@ slapd_daemon_task(
 #endif /* LDAP_DEBUG */
 
                for ( i = 0; i < ns; i++ ) {
-                       int rc = 1, fd;
+                       int rc = 1, fd, w = 0;
 
                        if ( SLAP_EVENT_IS_LISTENER( i ) ) {
                                rc = slap_listener_activate( SLAP_EVENT_LISTENER( i ) );
@@ -2522,6 +2522,7 @@ slapd_daemon_task(
                                                fd, 0, 0 );
 
                                        SLAP_EVENT_CLR_WRITE( i );
+                                       w = 1;
 
                                        /*
                                         * NOTE: it is possible that the connection was closed
@@ -2541,7 +2542,7 @@ slapd_daemon_task(
 
                                        SLAP_EVENT_CLR_READ( i );
                                        connection_read_activate( fd );
-                               } else {
+                               } else if ( !w ) {
                                        Debug( LDAP_DEBUG_CONNS,
                                                "daemon: hangup on %d\n", fd, 0, 0 );
                                        connection_hangup( fd );