summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-20 14:05:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-20 14:05:48 +0000
commitd4e61c1552dc58ef174a82c05f7ed5f907d29a47 (patch)
tree3716b7b1bca383eff882bbfa0acb3d4b6e8b4ae3
parent30a17a7034a5afce1094479628408a0903c62e17 (diff)
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
-rw-r--r--src/socketengine_iocp.cpp11
1 files changed, 10 insertions, 1 deletions
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<int, EventHandler*>::value_type( eh->GetFd(), eh ) );
+ try
+ {
+ m_binding.insert( map<int, EventHandler*>::value_type( eh->GetFd(), eh ) );
+ }
+ catch (...)
+ {
+ /* Ohshi-, map::insert failed :/ */
+ return false;
+ }
+
return true;
}