[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] we seem to have lost our define for FD_SETSIZE on win32 in ...



Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	or.h 
Log Message:
we seem to have lost our define for FD_SETSIZE on win32 in the change
from fakepoll to libevent. be sure to define it *before* we include
winsock.


Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.576
retrieving revision 1.577
diff -u -d -r1.576 -r1.577
--- or.h	27 Mar 2005 06:37:56 -0000	1.576
+++ or.h	27 Mar 2005 22:52:48 -0000	1.577
@@ -97,7 +97,20 @@
 #include <time.h>
 #endif
 
+/** Upper bound on maximum simultaneous connections; can be lowered by
+ * config file. */
+#define MAXCONNECTIONS 15000
+
 #ifdef MS_WINDOWS
+/* This trick makes winsock resize fd_set, which defaults to the
+ * insanely low 64. */
+#define FD_SETSIZE MAXCONNECTIONS
+/* XXXX But Windows FD_SET and FD_CLR are tremendously ugly, and linear in
+ *   the total number of sockets set! Perhaps we should eventually use
+ *   WSAEventSelect and WSAWaitForMultipleEvents instead of select? -NM
+ *   I'm told these funcs have an unchangeable 64 conn limit on 95/98,
+ *   so maybe not. -RD */
+
 #if (_MSC_VER <= 1300)
 #include <winsock.h>
 #else
@@ -138,10 +151,6 @@
  * so you can get a coredump and track things down. */
 #undef TOR_FRAGILE
 
-/** Upper bound on maximum simultaneous connections; can be lowered by
- * config file. */
-#define MAXCONNECTIONS 15000
-
 #define DEFAULT_BANDWIDTH_OP (1024 * 1000)
 #define MAX_NICKNAME_LEN 19
 /* Hex digest plus dollar sign. */