summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-03-27 22:52:48 +0000
committerRoger Dingledine <arma@torproject.org>2005-03-27 22:52:48 +0000
commit96c331e4ed0608357fed5830a4d9651aba374c26 (patch)
tree96199b9bda4afb4046b70c5f8e019f0cf29aa795
parent9b5432214d4c232da7c26ae427ed5186e3ad07b0 (diff)
downloadtor-96c331e4ed0608357fed5830a4d9651aba374c26.tar.gz
tor-96c331e4ed0608357fed5830a4d9651aba374c26.zip
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. svn:r3903
-rw-r--r--src/or/or.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 8c0d144b6a..5ceeffff4c 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -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. */