From 8cebdce0933438c32fc5821dd16d090ea06fd8cc Mon Sep 17 00:00:00 2001 From: burlex Date: Wed, 15 Aug 2007 20:41:30 +0000 Subject: * include/caller.h will now compile correctly on Windows platforms. + Implemented gettimeofday in win32 wrapper, link rtt's will now display in milliseconds. * SocketEngine::BoundsCheckFd will now handle Windows event handler cases correctly. (fixing writing to sockets not working) * Fixed VC71 project. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7723 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/socketengine.cpp') 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 } -- cgit v1.2.3