summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-31 18:30:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-31 18:30:25 +0000
commitf4a1bfe7c060f633de970287ff5e49dcc57f5a9a (patch)
treec0121138bfc60a36da06803b54ebb0abf92ccf9f
parentd0a0de4044bf0d48a876189ecefda95141246775 (diff)
We dont want kqueue to go into an infinite loop when netsplitting, do we.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5605 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/socketengine_kqueue.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/socketengine_kqueue.cpp b/src/socketengine_kqueue.cpp
index 4e5679c77..9a63c972f 100644
--- a/src/socketengine_kqueue.cpp
+++ b/src/socketengine_kqueue.cpp
@@ -92,14 +92,16 @@ bool KQueueEngine::DelFd(EventHandler* eh)
return false;
struct kevent ke;
- EV_SET(&ke, fd, eh->Readable() ? EVFILT_READ : EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
+ EV_SET(&ke, eh->GetFd(), EVFILT_READ, EV_DELETE, 0, 0, NULL);
int i = kevent(EngineHandle, &ke, 1, 0, 0, NULL);
- if (i == -1)
- {
- ServerInstance->Log(DEBUG,"kqueue: Failed to remove socket from queue: %s",strerror(errno));
+
+ EV_SET(&ke, eh->GetFd(), EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
+
+ int j = kevent(EngineHandle, &ke, 1, 0, 0, NULL);
+
+ if ((j < 0) && (i < 0))
return false;
- }
CurrentSetSize--;
ref[fd] = NULL;