diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-01-14 18:45:03 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-01-14 18:45:03 +0000 |
commit | 33457adb681562e8b66ba417e3791510adfd0c1e (patch) | |
tree | 476bfd2e58a4772dcc42ea12b9834def45201ab0 /src/socketengines | |
parent | b1b62edd3c259879f518d96d10c075bf847a215d (diff) |
Revert some of w00ts kqueue massacre from september, for some reason its not too stable, e.g. placing wantwrite sockets into oneshot wantread? :P
randomly uses 100% cpu with the newer code, seems kqueue doesnt quite like to work exactly the same as epoll and poll.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10960 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengines')
-rw-r--r-- | src/socketengines/socketengine_kqueue.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 411686aac..feb377735 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -116,7 +116,6 @@ 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); } @@ -166,7 +165,7 @@ int KQueueEngine::DispatchEvents() ref[ke_list[j].ident]->HandleEvent(EVENT_ERROR, ke_list[j].fflags); continue; } - if (ke_list[j].flags & EVFILT_WRITE) + else if (ke_list[j].flags & EVFILT_WRITE) { /* This looks wrong but its right. As above, theres no modify * call in kqueue. See the manpage. @@ -181,8 +180,7 @@ int KQueueEngine::DispatchEvents() if (ref[ke_list[j].ident]) ref[ke_list[j].ident]->HandleEvent(EVENT_WRITE); } - - if (ke_list[j].flags & EVFILT_READ) + else { ReadEvents++; if (ref[ke_list[j].ident]) |