summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-18 12:19:01 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-18 12:19:01 +0000
commit8e0a882551d02e29d5a1617d08c6c00100c6ce74 (patch)
tree355ff3d75ec3dc0742f30c31de16b50c6bb78310 /src
parentb7bc2a20771eb514553fd475079578763b12acd6 (diff)
Fix what should have been the (real) problems with kqueue, so far so good for me.. this *does* need more testing though. Fix spotted by dz (check .filter, not .flags, and don't try to use it as a bitmask). TOR, ratbox, and similar projects use code like this, so I am fairly confident it is ok.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10971 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/socketengines/socketengine_kqueue.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp
index 411686aac..c07684506 100644
--- a/src/socketengines/socketengine_kqueue.cpp
+++ b/src/socketengines/socketengine_kqueue.cpp
@@ -126,7 +126,7 @@ int KQueueEngine::GetMaxFds()
if (!MAX_DESCRIPTORS)
{
int mib[2], maxfiles;
- size_t len;
+ size_t len;
mib[0] = CTL_KERN;
mib[1] = KERN_MAXFILES;
@@ -166,7 +166,7 @@ int KQueueEngine::DispatchEvents()
ref[ke_list[j].ident]->HandleEvent(EVENT_ERROR, ke_list[j].fflags);
continue;
}
- if (ke_list[j].flags & EVFILT_WRITE)
+ if (ke_list[j].filter == EVFILT_WRITE)
{
/* This looks wrong but its right. As above, theres no modify
* call in kqueue. See the manpage.
@@ -181,8 +181,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)
+ if (ke_list[j].flags == EVFILT_READ)
{
ReadEvents++;
if (ref[ke_list[j].ident])