summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index 28ba8c252..3aef464e6 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -93,10 +93,24 @@ std::string SocketEngine::GetName()
bool SocketEngine::BoundsCheckFd(EventHandler* eh)
{
+#ifdef WINDOWS
+ int * internal_fd;
+ if(!eh || eh->GetFd() < 0)
+ return false;
+
+ if(!eh->GetExt("internal_fd", internal_fd))
+ return false;
+
+ if(*internal_fd > MAX_DESCRIPTORS)
+ return false;
+
+ return true;
+#else
if (!eh)
return false;
if ((eh->GetFd() < 0) || (eh->GetFd() > MAX_DESCRIPTORS))
return false;
return true;
+#endif
}