View Issue Details

IDProjectCategoryView StatusLast Update
0001974GNUnetobsoletepublic2024-05-03 11:51
ReporterLRN Assigned ToLRN Due Date
PrioritylowSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.9.1Fixed in Version0.9.1 
Summary0001974: Increase FD_SETSIZE on W32
DescriptionOn 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.
TagsNo tags attached.
Attached Files
0001-Increate-FD_SETSIZE-on-W32-from-64-to-1024.patch (1,990 bytes)   
From d970f56b1b346c5438695c521f9bfa633024e26c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1?=
 =?UTF-8?q?=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Fri, 2 Dec 2011 05:36:57 +0400
Subject: [PATCH 1/5] Increate FD_SETSIZE on W32 from 64 to 1024

---
 src/include/platform.h                     |    3 +++
 src/include/winproc.h                      |    3 +++
 src/nat/gnunet-helper-nat-client-windows.c |    1 +
 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 aa24347..8c1e6d6 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 <Winsock2.h>
 #include <ws2tcpip.h>
 #else
diff --git a/src/include/winproc.h b/src/include/winproc.h
index 74e41ed..e65a3b5 100644
--- a/src/include/winproc.h
+++ b/src/include/winproc.h
@@ -34,6 +34,9 @@
 #include <sys/timeb.h>
 #include <time.h>
 #include <dirent.h>
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 1024
+#endif
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <windows.h>
diff --git a/src/nat/gnunet-helper-nat-client-windows.c b/src/nat/gnunet-helper-nat-client-windows.c
index 864c911..47fbc0b 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 <winsock2.h>
 #include <ws2tcpip.h>
 #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 8386a15..b15752d 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 <winsock2.h>
 #include <ws2tcpip.h>
 #include <sys/time.h>
-- 
1.7.4

Activities

Christian Grothoff

2011-12-06 12:49

manager   ~0005010

SVN 18445.

Issue History

Date ModifiedUsernameFieldChange
2011-12-02 01:49LRNNew Issue
2011-12-02 01:49LRNStatusnew => assigned
2011-12-02 01:49LRNAssigned To => NDurner
2011-12-02 01:49LRNFile Added: 0001-Increate-FD_SETSIZE-on-W32-from-64-to-1024.patch
2011-12-06 12:49Christian GrothoffNote Added: 0005010
2011-12-06 12:49Christian GrothoffStatusassigned => resolved
2011-12-06 12:49Christian GrothoffFixed in Version => 0.9.1
2011-12-06 12:49Christian GrothoffResolutionopen => fixed
2011-12-06 12:49Christian GrothoffAssigned ToNDurner => LRN
2011-12-06 14:15Christian GrothoffTarget Version => 0.9.1
2011-12-26 21:28Christian GrothoffStatusresolved => closed
2024-01-12 13:28schanzenCategoryWin32 port => Win32 port (deprecated)
2024-05-03 11:51Christian GrothoffCategoryWin32 port (deprecated) => obsolete