]> git.sur5r.net Git - openldap/commitdiff
Don't check fd_sets until after we check fd < dtblsize
authorKurt Zeilenga <kurt@openldap.org>
Mon, 18 Sep 2000 19:01:21 +0000 (19:01 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 18 Sep 2000 19:01:21 +0000 (19:01 +0000)
servers/slapd/daemon.c

index 997a1ea1bb9c5ab5f34c4ad8b76b2a10795043a3..bca5aed17b2b2f358647836dfacc36c3e1ec8a5d 100644 (file)
@@ -870,11 +870,21 @@ slapd_daemon_task(
                                continue;
                        }
 
+#ifndef HAVE_WINSOCK
+                       /* make sure descriptor number isn't too great */
+                       if ( s >= dtblsize ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "daemon: %ld beyond descriptor table size %ld\n",
+                                       (long) s, (long) dtblsize, 0 );
+                               slapd_close(s);
+                               continue;
+                       }
+#endif
+
 #ifdef LDAP_DEBUG
                        ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
 
                        /* newly accepted stream should not be in any of the FD SETS */
-
                        assert( !FD_ISSET( s, &slap_daemon.sd_actives) );
                        assert( !FD_ISSET( s, &slap_daemon.sd_readers) );
                        assert( !FD_ISSET( s, &slap_daemon.sd_writers) );
@@ -882,17 +892,6 @@ slapd_daemon_task(
                        ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
 #endif
 
-#ifndef HAVE_WINSOCK
-                       /* make sure descriptor number isn't too great */
-                       if ( s >= dtblsize ) {
-                               Debug( LDAP_DEBUG_ANY,
-                                       "daemon: %ld beyond descriptor table size %ld\n",
-                                       (long) s, (long) dtblsize, 0 );
-                               slapd_close(s);
-                               continue;
-                       }
-#endif
-                  
                        Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n",
                                (long) s, 0, 0 );