diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 18:23:15 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 18:23:15 +0000 |
commit | f5bc7aa7ceaee27df4aa047f3b702619f15fa00c (patch) | |
tree | 9483b5cc4c6441e445a1ae8c21ff9156a9c88e33 /src/socketengine_select.cpp | |
parent | 906a91e917c22c793fe280ca657967a9e5d2e3b4 (diff) |
Untested, new clever pointer voodoo class for binary-safe ziplinks output buffers
PLUS: Fix for random epoll dispatchevents crashes.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5926 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine_select.cpp')
-rw-r--r-- | src/socketengine_select.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/socketengine_select.cpp b/src/socketengine_select.cpp index 19a2ec882..b7a9c3597 100644 --- a/src/socketengine_select.cpp +++ b/src/socketengine_select.cpp @@ -147,22 +147,26 @@ int SelectEngine::DispatchEvents() { if (getsockopt(ev[i]->GetFd(), SOL_SOCKET, SO_ERROR, &errcode, &codesize) < 0) errcode = errno; - ev[i]->HandleEvent(EVENT_ERROR, errcode); + + v[i]->HandleEvent(EVENT_ERROR, errcode); } continue; } - ServerInstance->Log(DEBUG,"Handle %s event on fd %d",writeable[ev[i]->GetFd()] || !ev[i]->Readable() ? "write" : "read", ev[i]->GetFd()); - if (writeable[ev[i]->GetFd()]) + if (ev[i]) { - if (ev[i]) - ev[i]->HandleEvent(EVENT_WRITE); - writeable[ev[i]->GetFd()] = false; - - } - else - { - if (ev[i]) - ev[i]->HandleEvent(ev[i]->Readable() ? EVENT_READ : EVENT_WRITE); + ServerInstance->Log(DEBUG,"Handle %s event on fd %d",writeable[ev[i]->GetFd()] || !ev[i]->Readable() ? "write" : "read", ev[i]->GetFd()); + if (writeable[ev[i]->GetFd()]) + { + if (ev[i]) + ev[i]->HandleEvent(EVENT_WRITE); + writeable[ev[i]->GetFd()] = false; + + } + else + { + if (ev[i]) + ev[i]->HandleEvent(ev[i]->Readable() ? EVENT_READ : EVENT_WRITE); + } } } } |