diff options
Diffstat (limited to 'src/socketengine_epoll.cpp')
-rw-r--r-- | src/socketengine_epoll.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp index df79aa083..ec5362f8c 100644 --- a/src/socketengine_epoll.cpp +++ b/src/socketengine_epoll.cpp @@ -49,7 +49,7 @@ bool EPollEngine::AddFd(EventHandler* eh) return false; if (ref[fd]) - DelFd(ref[fd]); + return false; struct epoll_event ev; memset(&ev,0,sizeof(struct epoll_event)); @@ -86,9 +86,6 @@ bool EPollEngine::DelFd(EventHandler* eh, bool force) if ((fd < 0) || (fd > MAX_DESCRIPTORS)) return false; - ref[fd] = NULL; - CurrentSetSize--; - struct epoll_event ev; memset(&ev,0,sizeof(struct epoll_event)); eh->Readable() ? ev.events = EPOLLIN : ev.events = EPOLLOUT; @@ -101,6 +98,9 @@ bool EPollEngine::DelFd(EventHandler* eh, bool force) return false; } + ref[fd] = NULL; + CurrentSetSize--; + ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd); return true; } |