From f5bc7aa7ceaee27df4aa047f3b702619f15fa00c Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 11 Dec 2006 18:23:15 +0000 Subject: 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 --- src/socketengine_epoll.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/socketengine_epoll.cpp') diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp index 06124a48c..bc0013b4c 100644 --- a/src/socketengine_epoll.cpp +++ b/src/socketengine_epoll.cpp @@ -140,7 +140,8 @@ int EPollEngine::DispatchEvents() if (events[j].events & EPOLLHUP) { ServerInstance->Log(DEBUG,"Handle error event on fd %d", events[j].data.fd); - ref[events[j].data.fd]->HandleEvent(EVENT_ERROR, 0); + if (ref[events[j].data.fd]) + ref[events[j].data.fd]->HandleEvent(EVENT_ERROR, 0); continue; } if (events[j].events & EPOLLERR) @@ -149,7 +150,8 @@ int EPollEngine::DispatchEvents() if (getsockopt(events[j].data.fd, SOL_SOCKET, SO_ERROR, &errcode, &codesize) < 0) errcode = errno; ServerInstance->Log(DEBUG,"Handle error event on fd %d: %s", events[j].data.fd, strerror(errcode)); - ref[events[j].data.fd]->HandleEvent(EVENT_ERROR, errcode); + if (ref[events[j].data.fd]) + ref[events[j].data.fd]->HandleEvent(EVENT_ERROR, errcode); continue; } if (events[j].events & EPOLLOUT) -- cgit v1.2.3