From: Christian Grothoff Date: Tue, 6 Dec 2011 12:49:06 +0000 (+0000) Subject: LRN: Fixing Mantis #1974: On W32 winsock2.h defines FD_SETSIZE (if it was not defined... X-Git-Tag: initial-import-from-subversion-38251~15726 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f39b3686f461388b6f1f61e2110832d0c7005a2f;p=oweals%2Fgnunet.git 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. --- 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 @@ #endif #ifdef _MSC_VER +#ifndef FD_SETSIZE +#define FD_SETSIZE 1024 +#endif #include #include #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 @@ #include #include #include +#ifndef FD_SETSIZE +#define FD_SETSIZE 1024 +#endif #include #include #include 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 @@ */ #define _GNU_SOURCE +#define FD_SETSIZE 1024 #include #include #include 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 @@ */ #define _GNU_SOURCE - +#define FD_SETSIZE 1024 #include #include #include