From d4e61c1552dc58ef174a82c05f7ed5f907d29a47 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 20 May 2007 14:05:48 +0000 Subject: try...catch around the map::insert in AddFd, for some reason it throws sometimes. If it does, we return false, which the core can handle neatly as 'failed to add fd' git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7065 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengine_iocp.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp index 9070f4d49..bab328660 100644 --- a/src/socketengine_iocp.cpp +++ b/src/socketengine_iocp.cpp @@ -68,7 +68,16 @@ bool IOCPEngine::AddFd(EventHandler* eh) WantWrite(eh); // we're all good =) - m_binding.insert( map::value_type( eh->GetFd(), eh ) ); + try + { + m_binding.insert( map::value_type( eh->GetFd(), eh ) ); + } + catch (...) + { + /* Ohshi-, map::insert failed :/ */ + return false; + } + return true; } -- cgit v1.2.3