]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socketengine_iocp.cpp
Add <hostchange:ports> to the m_hostchange module to implement feature in bug #363
[user/henk/code/inspircd.git] / src / socketengine_iocp.cpp
index 3581904ed34e7de9880ce3d6099f90ce5119bf65..4eb9f83cd69a25135f8645c3af8f81c20739b45d 100644 (file)
@@ -456,15 +456,16 @@ bool IOCPEngine::HasFd(int fd)
 
 bool IOCPEngine::BoundsCheckFd(EventHandler* eh)
 {
-       int* fake_fd = NULL;
-       if (!eh)
-               return false;
-       if (!eh->GetExt("internal_fd", fake_fd))
+       int * internal_fd;
+       if (!eh || eh->GetFd() < 0)
                return false;
-       if ((*fake_fd < 0) || (*fake_fd > MAX_DESCRIPTORS))
+
+       if(!eh->GetExt("internal_fd", internal_fd))
                return false;
-       if ((eh->GetFd() < 0) || (eh->GetFd() > MAX_DESCRIPTORS))
+
+       if(*internal_fd > MAX_DESCRIPTORS)
                return false;
+
        return true;
 }