diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-06 12:49:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-06 12:49:06 +0000 |
commit | f39b3686f461388b6f1f61e2110832d0c7005a2f (patch) | |
tree | f6cd7f76b26e67063fe4d07a94632f867da68a89 /src | |
parent | 66ad61315839233a4cc65e98d12e36c3a3c1896e (diff) | |
download | gnunet-f39b3686f461388b6f1f61e2110832d0c7005a2f.tar.gz gnunet-f39b3686f461388b6f1f61e2110832d0c7005a2f.zip |
LRN: Fixing Mantis #1974: On W32 winsock2.h defines FD_SETSIZE (if it was not defined before inclusion of the header) to 64, which means that it's not possible to select on more than 64 sockets at once. This might work during the tests, but in the wild people might want to have more than 60 connections, at least in the transport service.
The patch attached should increase the limit to 1024.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/platform.h | 3 | ||||
-rw-r--r-- | src/include/winproc.h | 3 | ||||
-rw-r--r-- | src/nat/gnunet-helper-nat-client-windows.c | 1 | ||||
-rw-r--r-- | src/nat/gnunet-helper-nat-server-windows.c | 2 |
4 files changed, 8 insertions, 1 deletions
diff --git a/src/include/platform.h b/src/include/platform.h index aa2434731..8c1e6d601 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -77,6 +77,9 @@ | |||
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef _MSC_VER | 79 | #ifdef _MSC_VER |
80 | #ifndef FD_SETSIZE | ||
81 | #define FD_SETSIZE 1024 | ||
82 | #endif | ||
80 | #include <Winsock2.h> | 83 | #include <Winsock2.h> |
81 | #include <ws2tcpip.h> | 84 | #include <ws2tcpip.h> |
82 | #else | 85 | #else |
diff --git a/src/include/winproc.h b/src/include/winproc.h index 74e41edc9..e65a3b55c 100644 --- a/src/include/winproc.h +++ b/src/include/winproc.h | |||
@@ -34,6 +34,9 @@ | |||
34 | #include <sys/timeb.h> | 34 | #include <sys/timeb.h> |
35 | #include <time.h> | 35 | #include <time.h> |
36 | #include <dirent.h> | 36 | #include <dirent.h> |
37 | #ifndef FD_SETSIZE | ||
38 | #define FD_SETSIZE 1024 | ||
39 | #endif | ||
37 | #include <winsock2.h> | 40 | #include <winsock2.h> |
38 | #include <ws2tcpip.h> | 41 | #include <ws2tcpip.h> |
39 | #include <windows.h> | 42 | #include <windows.h> |
diff --git a/src/nat/gnunet-helper-nat-client-windows.c b/src/nat/gnunet-helper-nat-client-windows.c index 864c911b0..47fbc0b86 100644 --- a/src/nat/gnunet-helper-nat-client-windows.c +++ b/src/nat/gnunet-helper-nat-client-windows.c | |||
@@ -43,6 +43,7 @@ | |||
43 | */ | 43 | */ |
44 | #define _GNU_SOURCE | 44 | #define _GNU_SOURCE |
45 | 45 | ||
46 | #define FD_SETSIZE 1024 | ||
46 | #include <winsock2.h> | 47 | #include <winsock2.h> |
47 | #include <ws2tcpip.h> | 48 | #include <ws2tcpip.h> |
48 | #include <sys/time.h> | 49 | #include <sys/time.h> |
diff --git a/src/nat/gnunet-helper-nat-server-windows.c b/src/nat/gnunet-helper-nat-server-windows.c index 8386a15b1..b15752d8e 100644 --- a/src/nat/gnunet-helper-nat-server-windows.c +++ b/src/nat/gnunet-helper-nat-server-windows.c | |||
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | #define _GNU_SOURCE | 43 | #define _GNU_SOURCE |
44 | 44 | ||
45 | 45 | #define FD_SETSIZE 1024 | |
46 | #include <winsock2.h> | 46 | #include <winsock2.h> |
47 | #include <ws2tcpip.h> | 47 | #include <ws2tcpip.h> |
48 | #include <sys/time.h> | 48 | #include <sys/time.h> |