]> jfr.im git - solanum.git/commit - libratbox/src/kqueue.c
Fix kqueue sometimes dropping updates.
authorJilles Tjoelker <redacted>
Mon, 12 May 2008 16:54:20 +0000 (18:54 +0200)
committerJilles Tjoelker <redacted>
Mon, 12 May 2008 16:54:20 +0000 (18:54 +0200)
commit3c95b6e72fb70dcbb7dbcacd437e6a6d0d5e74a2
tree61e759b792c62e57054a6755a3f37d78c5124c25
parentedd8f6417d49c20fd4a9676fd9903f3d6a4ed421
Fix kqueue sometimes dropping updates.
(ircd wouldn't read or write anymore to certain clients)
This happens because kqueue.c will often try to add
already closed file descriptors to the kqueue. The kernel
tries to report bad file descriptors in the eventlist; if
the eventlist has no space, processing of the changelist
is silently halted.
The fix:
1. allocate two kqlst things, one for what kqlst currently does
and one as output buffer
this ensures the kevent(2) call in rb_select_kqueue() never
drops updates
2. replace the kevent(2) call in kq_update_events() by a loop
that processes the updates one at a time
that doesn't happen much, and it's the only way to be sure
without also getting events out of the queue we cannot process
at that time
libratbox r25354 (jilles)
libratbox/src/kqueue.c