summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-07 11:23:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-07 11:23:40 +0000
commit23eb8eb48153c908d560e325259c939ad4096a73 (patch)
treed05c7850b81eeed91ad3cdf209311d87f0c97fee
parent934cf2dafc93f0443c2473a451cc77f27b9e19ed (diff)
Fix (we hope!) for the 'internal error processing connection' bug. Thanks to jamie and shadow for enduring this one while we hunted it down.
Its complicated, bug one of us for more info if youre really interested. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5446 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspsocket.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index eb0ee86c8..4a37b1b04 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -369,7 +369,7 @@ void SocketTimeout::Tick(time_t now)
{
if (ServerInstance->SE->GetRef(this->sfd) != this->sock)
{
- ServerInstance->Log(DEBUG,"No FD or socket ref");
+ ServerInstance->Log(DEBUG,"Our socket has been deleted before the timeout was reached.");
return;
}
@@ -383,8 +383,12 @@ void SocketTimeout::Tick(time_t now)
this->sock->OnTimeout();
this->sock->OnError(I_ERR_TIMEOUT);
this->sock->timeout = true;
- this->sock->state = I_ERROR;
ServerInstance->SE->DelFd(this->sock);
+ /* NOTE: We must set this AFTER DelFd, as we added
+ * this socket whilst writeable. This means that we
+ * must DELETE the socket whilst writeable too!
+ */
+ this->sock->state = I_ERROR;
this->sock->Close();
delete this->sock;
return;