summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 16:25:34 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 16:25:34 +0000
commit20e3875e35b8e4801ef22eb72de8508c0879d518 (patch)
treedc2af26416d9a77d26dccc38951e6e8addb65db2 /src/common
parent16f5b05e5dbd83c9ec2047acbd86702121ba4c30 (diff)
downloadhercules-20e3875e35b8e4801ef22eb72de8508c0879d518.tar.gz
hercules-20e3875e35b8e4801ef22eb72de8508c0879d518.tar.bz2
hercules-20e3875e35b8e4801ef22eb72de8508c0879d518.tar.xz
hercules-20e3875e35b8e4801ef22eb72de8508c0879d518.zip
- Modified waiting_disconnect on the login server to hold the timer id of the 'set offline' timer.
- connect_client will no longer accept connections when their number is greater than FD_SETSIZE to prevent crashes on packet parsing. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10110 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-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);