From 1d4be8defb49d0924dbbc26def422b385f26c80e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 6 Jul 2019 09:24:44 -1100 Subject: [PATCH] Revert FD_SETSIZE --- src/compat.h | 2 +- src/init.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compat.h b/src/compat.h index b0730d1aa..44b7dcee2 100644 --- a/src/compat.h +++ b/src/compat.h @@ -39,7 +39,7 @@ #ifdef FD_SETSIZE #undef FD_SETSIZE // prevent redefinition compiler warning #endif -#define FD_SETSIZE (8*1024) // max number of fds in fd_set +#define FD_SETSIZE 1024 // max number of fds in fd_set #include // Must be included before mswsock.h and windows.h diff --git a/src/init.cpp b/src/init.cpp index 3cc2d8f63..738d94377 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -979,7 +979,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) //fprintf(stderr,"nMaxConnections %d\n",nMaxConnections); nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0); int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS); - fprintf(stderr,"nMaxConnections %d FD_SETSIZE.%d nBind.%d expr.%d \n",nMaxConnections,FD_SETSIZE,nBind,(int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)); + //fprintf(stderr,"nMaxConnections %d FD_SETSIZE.%d nBind.%d expr.%d \n",nMaxConnections,FD_SETSIZE,nBind,(int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)); if (nFD < MIN_CORE_FILEDESCRIPTORS) return InitError(_("Not enough file descriptors available.")); if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)