summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-11 20:27:03 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-11 20:27:03 +0000
commit2abcc65d696dbb24c1515fd756a1bc648bcb0d02 (patch)
tree5bb5d9522abd122ba2a7f9f7771ff60027ee58a1
parent7f0a9608c895bf437f746cbca16d9fbad158b782 (diff)
When we get events on unknown file descriptors, unregister them rather than spinning at 100% CPU
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12436 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/socketengines/socketengine_epoll.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp
index 96c3922f9..934106e54 100644
--- a/src/socketengines/socketengine_epoll.cpp
+++ b/src/socketengines/socketengine_epoll.cpp
@@ -195,7 +195,11 @@ int EPollEngine::DispatchEvents()
{
EventHandler* eh = ref[events[j].data.fd];
if (!eh)
+ {
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"Got event on unknown fd: %d", events[j].data.fd);
+ epoll_ctl(EngineHandle, EPOLL_CTL_DEL, events[j].data.fd, &events[j]);
continue;
+ }
if (events[j].events & EPOLLHUP)
{
ErrorEvents++;