aboutsummaryrefslogtreecommitdiff
path: root/src/socketengine_iocp.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-07-27 16:50:53 +0000
committerGravatar brain2007-07-27 16:50:53 +0000
commitac3af8b61e9601d9585510d99891e993eb3a2722 (patch)
tree531ae6aab2e4122cbc5d03b0580876ecd68d77c9 /src/socketengine_iocp.cpp
parentMove a bunch of stuff around for tidyness, win32 functions keep creeping into... (diff)
Some smart tricks to eliminate win32 ifdefs that are creeping into portable files
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7589 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine_iocp.cpp')
-rw-r--r--src/socketengine_iocp.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp
index c61b44062..dad8b8a0a 100644
--- a/src/socketengine_iocp.cpp
+++ b/src/socketengine_iocp.cpp
@@ -420,6 +420,17 @@ bool IOCPEngine::HasFd(int fd)
return (GetRef(fd) != 0);
}
+bool IOCPEngine::BoundsCheckFd(EventHandler* eh)
+{
+ if (!eh)
+ return false;
+ if ((eh->m_internalFd < 0) || (eh->m_internalFd > MAX_DESCRIPTORS))
+ return false;
+ if ((eh->GetFd() < 0) || (eh->GetFd() > MAX_DESCRIPTORS))
+ return false;
+ return true;
+}
+
EventHandler * IOCPEngine::GetIntRef(int fd)
{
if(fd < 0 || fd > MAX_DESCRIPTORS)