summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index d816767ae..4e001c512 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -248,6 +248,12 @@ int connect_client(int listen_fd)
return -1;
}
+ if ( fd >= FD_SETSIZE )
+ { //More connections than we can handle!
+ ShowError("accept failed. Received socket #%d is greater than can we handle! Increase the value of FD_SETSIZE (%d) for your OS to fix this!\n", fd, FD_SETSIZE);
+ closesocket(fd);
+ return -1;
+ }
setsocketopts(fd);
set_nonblocking(fd, 1);