Make add_socketread() close the new socket if it can't be added to the

socket manager because it exceeds FD_SETSIZE.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@307 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-08-07 23:03:45 +00:00
parent 718e53d6f0
commit 6691732900
2 changed files with 6 additions and 0 deletions

View File

@@ -3514,7 +3514,11 @@ int BX_add_socketread(int s, int port, unsigned long flags, char *server, void (
set_socket_read(&rd, &rd);
}
if (s >= FD_SETSIZE)
{
yell("File descriptor limit reached, dropping new socket.");
close(s);
return -1;
}
if (s > sock_manager.max_fd)
sock_manager.max_fd = s;
sock_manager.count++;