Revert FD_SETSIZE
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
#ifdef FD_SETSIZE
|
#ifdef FD_SETSIZE
|
||||||
#undef FD_SETSIZE // prevent redefinition compiler warning
|
#undef FD_SETSIZE // prevent redefinition compiler warning
|
||||||
#endif
|
#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 <winsock2.h> // Must be included before mswsock.h and windows.h
|
#include <winsock2.h> // Must be included before mswsock.h and windows.h
|
||||||
|
|
||||||
|
|||||||
@@ -979,7 +979,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
//fprintf(stderr,"nMaxConnections %d\n",nMaxConnections);
|
//fprintf(stderr,"nMaxConnections %d\n",nMaxConnections);
|
||||||
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
|
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
|
||||||
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
|
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)
|
if (nFD < MIN_CORE_FILEDESCRIPTORS)
|
||||||
return InitError(_("Not enough file descriptors available."));
|
return InitError(_("Not enough file descriptors available."));
|
||||||
if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)
|
if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)
|
||||||
|
|||||||
Reference in New Issue
Block a user