From dc12fcac8757b36b7da88d0a9ff25acc009d539c Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 29 Dec 2005 16:33:26 +0000 Subject: Added extra checking to socketengine to refuse connections after we reach the max git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2697 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengine.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/socketengine.cpp') diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 3e0b3814d..69838ff59 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2005 ChatSpike-Dev. + * Inspire is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: * * @@ -19,7 +19,6 @@ #include "inspircd.h" #ifdef USE_EPOLL #include -#define EP_DELAY 5 #endif #ifdef USE_KQUEUE #include @@ -67,6 +66,11 @@ bool SocketEngine::AddFd(int fd, bool readable, char type) { if ((fd < 0) || (fd > 65535)) return false; + if (GetRemainingFds() <= 1) + { + log(DEFAULT,"ERROR: System out of file descriptors!"); + return false; + } #ifdef USE_SELECT fds[fd] = fd; #endif -- cgit v1.2.3