From 5af0e15f15f0b09643dcdf6da3d9eb2349d16422 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 2 Mar 2010 01:48:06 +0000 Subject: Don't send events for removed FDs when both read and write are ready git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12582 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengines/socketengine_kqueue.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/socketengines/socketengine_kqueue.cpp') diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 63a877238..6f329357d 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -230,6 +230,10 @@ int KQueueEngine::DispatchEvents() const int bits_to_clr = FD_WANT_SINGLE_WRITE | FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK; SetEventMask(eh, eh->GetEventMask() & ~bits_to_clr); eh->HandleEvent(EVENT_WRITE); + + if (eh != ref[ke_list[j].ident]; + // whoops, deleted out from under us + continue; } if (ke_list[j].filter == EVFILT_READ) { -- cgit v1.2.3