From ba1d557ee3e1380f5b94f3d6c2aea0984d823213 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 11 Mar 2006 17:47:47 +0000 Subject: Added method to check if an fd is in the socketengine or not git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3667 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index 508d638cf..23d760002 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -287,6 +287,9 @@ bool InspSocket::FlushWriteBuffer() bool InspSocket::Timeout(time_t current) { + if (!socket_ref[this->fd] || !ServerInstance->SE->HasFd(this->fd)) + return false; + if (((this->state == I_RESOLVING) || (this->state == I_CONNECTING)) && (current > timeout_end)) { log(DEBUG,"Timed out, current=%lu timeout_end=%lu"); @@ -305,6 +308,9 @@ bool InspSocket::Timeout(time_t current) bool InspSocket::Poll() { + if (!socket_ref[this->fd] || !ServerInstance->SE->HasFd(this->fd)) + return true; + int incoming = -1; bool n = true; -- cgit v1.3.1-10-gc9f91