summaryrefslogtreecommitdiff
path: root/src/socketengine_kqueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine_kqueue.cpp')
-rw-r--r--src/socketengine_kqueue.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/socketengine_kqueue.cpp b/src/socketengine_kqueue.cpp
index 59e4c4812..e0e6fe029 100644
--- a/src/socketengine_kqueue.cpp
+++ b/src/socketengine_kqueue.cpp
@@ -110,7 +110,7 @@ bool KQueueEngine::DelFd(EventHandler* eh)
void KQueueEngine::WantWrite(EventHandler* eh)
{
struct kevent ke;
- EV_SET(&ke, eh->GetFd(), EVFILT_WRITE | EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, NULL);
+ EV_SET(&ke, eh->GetFd(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, NULL);
int i = kevent(EngineHandle, &ke, 1, 0, 0, NULL);
if (i == -1)
{
@@ -150,8 +150,12 @@ int KQueueEngine::DispatchEvents()
{
ServerInstance->Log(DEBUG,"kqueue: Unable to set fd %d back to just wanting to read!", ke_list[j].ident);
}
+ ref[ke_list[j].ident]->HandleEvent(EVENT_WRITE);
+ }
+ else
+ {
+ ref[ke_list[j].ident]->HandleEvent(EVENT_READ);
}
- ref[ke_list[j].ident]->HandleEvent(ke_list[j].flags & EVFILT_WRITE ? EVENT_WRITE : EVENT_READ);
}
return i;