]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Remove culllist.h from here, we no longer use it.
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index eb0ee86c82f524d8a5c48311f5847d055ed00ccf..4a37b1b04cffaef2400178d00c148da209edd541 100644 (file)
@@ -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;