diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-01-18 12:19:00 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-01-18 12:19:00 +0000 |
commit | b7bc2a20771eb514553fd475079578763b12acd6 (patch) | |
tree | f124197651454bae082d29c3bd611141c6f42043 /src | |
parent | 131870d884290b36d891c6e026c6c5bb79f84eef (diff) |
Revert "Revert some of w00ts kqueue massacre from september, for some reason its not too stable, e.g. placing wantwrite sockets into oneshot wantread? :P"
This reverts commit 11302829a008263dc306d08d675ad49d7d3f62ab.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10970 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/socketengines/socketengine_kqueue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index feb377735..411686aac 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -116,6 +116,7 @@ void KQueueEngine::WantWrite(EventHandler* eh) * the original setting rather than adding it twice. See man kqueue. */ struct kevent ke; + EV_SET(&ke, eh->GetFd(), EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, NULL); EV_SET(&ke, eh->GetFd(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, NULL); kevent(EngineHandle, &ke, 1, 0, 0, NULL); } @@ -165,7 +166,7 @@ int KQueueEngine::DispatchEvents() ref[ke_list[j].ident]->HandleEvent(EVENT_ERROR, ke_list[j].fflags); continue; } - else if (ke_list[j].flags & EVFILT_WRITE) + if (ke_list[j].flags & EVFILT_WRITE) { /* This looks wrong but its right. As above, theres no modify * call in kqueue. See the manpage. @@ -180,7 +181,8 @@ int KQueueEngine::DispatchEvents() if (ref[ke_list[j].ident]) ref[ke_list[j].ident]->HandleEvent(EVENT_WRITE); } - else + + if (ke_list[j].flags & EVFILT_READ) { ReadEvents++; if (ref[ke_list[j].ident]) |