+ ) continue;
+
+ r = SLAP_EVENT_IS_READ( i );
+ w = SLAP_EVENT_IS_WRITE( i );
+ if ( r || w ) {
+ Debug( LDAP_DEBUG_CONNS, " %d%s%s", SLAP_EVENT_FD(i),
+ r ? "r" : "", w ? "w" : "" );
+ }
+ }
+#endif
+ for (i=0; i<ns; i++) {
+ int rc = 1, fd;
+
+ if ( SLAP_EVENT_IS_LISTENER(i) ) {
+ rc = slapd_handle_listener( SLAP_EVENT_LISTENER( i ));
+ }
+ /* If we found a regular listener, rc is now zero, and we
+ * can skip the data portion. But if it was a UDP listener
+ * then rc is still 1, and we want to handle the data.
+ */
+ if ( rc ) {
+ fd = SLAP_EVENT_FD( i );
+
+ if( SLAP_EVENT_IS_WRITE( i ) ) {
+ Debug( LDAP_DEBUG_CONNS,
+ "daemon: write active on %d\n",
+ fd, 0, 0 );
+ /*
+ * NOTE: it is possible that the connection was closed
+ * and that the stream is now inactive.
+ * connection_write() must valid the stream is still
+ * active.
+ */
+
+ if ( connection_write( fd ) < 0 ) {
+ slapd_close( fd );
+ continue;
+ }
+ }
+ if( SLAP_EVENT_IS_READ( i ) ) {
+ Debug( LDAP_DEBUG_CONNS,
+ "daemon: read active on %d\n",
+ fd, 0, 0 );
+ /*
+ * NOTE: it is possible that the connection was closed
+ * and that the stream is now inactive.
+ * connection_read() must valid the stream is still
+ * active.
+ */
+
+ if ( connection_read( fd ) < 0 ) {
+ slapd_close( fd );
+ }
+ }
+ }
+ }
+#endif /* SLAP_EVENTS_ARE_INDEXED */
+
+#ifndef HAVE_YIELDING_SELECT