summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 12:44:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 12:44:43 +0000
commit280f52aeae72a3383e1e10b2f2a5952e7b1413b7 (patch)
treef2be3394b53fe6bb4fac93d5b74e2b839698d61c /src/socketengine.cpp
parentb81c2e4c4eda2c7ae6fa5fbccfe40c94852fdf3b (diff)
*EXPERIMENTAL* Tied DNS into new socket engine
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2331 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index 23088edb9..f19a8d082 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -40,12 +40,16 @@ SocketEngine::~SocketEngine()
char SocketEngine::GetType(int fd)
{
+ if ((fd < 0) || (fd > 65535))
+ return X_EMPTY_SLOT;
/* Mask off the top bit used for 'read/write' state */
return (ref[fd] & ~0x80);
}
bool SocketEngine::AddFd(int fd, bool readable, char type)
{
+ if ((fd < 0) || (fd > 65535))
+ return false;
this->fds.push_back(fd);
ref[fd] = type;
if (readable)
@@ -79,6 +83,10 @@ return true;
bool SocketEngine::DelFd(int fd)
{
log(DEBUG,"SocketEngine::DelFd(%d)",fd);
+
+ if ((fd < 0) || (fd > 65535))
+ return false;
+
bool found = false;
for (std::vector<int>::iterator i = fds.begin(); i != fds.end(); i++)
{