]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1475: Squid does not need to be limited by FD_SETSIZE when using kqueue/epoll.
authorhno <>
Wed, 17 May 2006 03:06:06 +0000 (03:06 +0000)
committerhno <>
Wed, 17 May 2006 03:06:06 +0000 (03:06 +0000)
Technically poll doesn't need to be limited either, but is due to the delay
pool hooks still using fd_set...

Inspired by the patch by Gonzalo Arana

src/main.cc
src/squid.h

index b9e240b68636eebbf1bec91f4d4518ce20bd9b83..bf357fa5c79769e8accde73968c56b407471dfff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.420 2006/05/08 23:38:33 robertc Exp $
+ * $Id: main.cc,v 1.421 2006/05/16 21:06:06 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -913,8 +913,12 @@ main(int argc, char **argv)
     Debug::parseOptions("ALL,1");
     debug_log = stderr;
 
-    if (FD_SETSIZE < Squid_MaxFD)
-        Squid_MaxFD = FD_SETSIZE;
+#if defined(SQUID_MAXFD_LIMIT)
+
+    if (SQUID_MAXFD_LIMIT < Squid_MaxFD)
+        Squid_MaxFD = SQUID_MAXFD_LIMIT;
+
+#endif
 
 #ifdef _SQUID_WIN32_
 
index c910a2c7ad085da0752870bfdccd25ebe37c8015..0b2a268df693eefa21e31e8ce0e3547eaf49999c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.252 2006/05/10 21:04:24 hno Exp $
+ * $Id: squid.h,v 1.253 2006/05/16 21:06:06 hno Exp $
  *
  * AUTHOR: Duane Wessels
  *
 #endif /* HAVE_POLL_H */
 #endif /* HAVE_POLL */
 
+/*
+ * Filedescriptor limits in the different select loops
+ */
+#if defined(USE_SELECT)
+/* Limited by design */
+#define SQUID_MAXFD_LIMIT FD_SETSIZE
+#elif defined(USE_POLL)
+/* Limited due to delay pools */
+#define SQUID_MAXFD_LIMIT FD_SETSIZE
+#elif defined(USE_KQUEUE) || defined(USE_EPOLL)
+#define fd_set ERROR_FD_SET_USED
+#else
+#error Unknown select loop model!
+#endif
+
+#
+
 #if defined(HAVE_STDARG_H)
 #include <stdarg.h>
 #define HAVE_STDARGS           /* let's hope that works everywhere (mj) */