From 2abcc65d696dbb24c1515fd756a1bc648bcb0d02 Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 11 Feb 2010 20:27:03 +0000 Subject: 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 --- src/socketengines/socketengine_epoll.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/socketengines/socketengine_epoll.cpp') 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++; -- cgit v1.2.3