diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-25 00:29:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-09-25 00:29:02 +0000 |
commit | fd5f65b6f5c1848c7922c3820a90f6020abbabb1 (patch) | |
tree | 58146a91f73a175b884bad95ca2942d397012206 /src/socketengine_iocp.cpp | |
parent | edf061fc6a7259f84a4e3be6f43c9e0601b3b39d (diff) |
Fix for bug #407, set ref[fd] AFTER some checks that may return false and leave the socket engine in an undefined state
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8077 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine_iocp.cpp')
-rw-r--r-- | src/socketengine_iocp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp index d66ca2ac4..96ff9eb31 100644 --- a/src/socketengine_iocp.cpp +++ b/src/socketengine_iocp.cpp @@ -74,10 +74,6 @@ bool IOCPEngine::AddFd(EventHandler* eh) if (!CreateIoCompletionPort((HANDLE)eh->GetFd(), m_completionPort, completion_key, 0)) return false; - /* set up binding, increase set size */ - ref[*fake_fd] = eh; - ++CurrentSetSize; - /* setup initial events */ if(is_accept) PostAcceptEvent(eh); @@ -101,6 +97,10 @@ bool IOCPEngine::AddFd(EventHandler* eh) /* Ohshi-, map::insert failed :/ */ return false; } + + ++CurrentSetSize; + ref[*fake_fd] = eh; + return true; } |