summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-11 17:47:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-11 17:47:47 +0000
commitba1d557ee3e1380f5b94f3d6c2aea0984d823213 (patch)
tree1f397ce02dfed39dcc3d0ca0e845123e340ba984 /src/socket.cpp
parent381412179424cac7961c31421f2768ef971783db (diff)
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
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp6
1 files changed, 6 insertions, 0 deletions
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;