summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/socketengine_epoll.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp
index 0e27e5248..cbf800a5c 100644
--- a/src/socketengine_epoll.cpp
+++ b/src/socketengine_epoll.cpp
@@ -80,7 +80,7 @@ bool EPollEngine::AddFd(EventHandler* eh)
void EPollEngine::WantWrite(EventHandler* eh)
{
struct epoll_event ev;
- ev.events = EPOLLOUT | EPOLLIN | EPOLLONESHOT;
+ ev.events = EPOLLOUT | EPOLLONESHOT;
ev.data.fd = eh->GetFd();
int i = epoll_ctl(EngineHandle, EPOLL_CTL_MOD, eh->GetFd(), &ev);
if (i < 0)
@@ -146,8 +146,12 @@ int EPollEngine::DispatchEvents()
{
ServerInstance->Log(DEBUG,"epoll: Could not reset fd %d!", events[j].data.fd);
}
+ ref[events[j].data.fd]->HandleEvent(EVENT_WRITE);
+ }
+ else
+ {
+ ref[events[j].data.fd]->HandleEvent(EVENT_READ);
}
- ref[events[j].data.fd]->HandleEvent(events[j].events & EPOLLOUT ? EVENT_WRITE : EVENT_READ);
}
return i;