]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Dump sendq before closing socket
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index 1fbe3b5abbc9fed6866dc098058437b38cce7ce8..65b554006a3207f86248b00b629f92c68b3ce5c7 100644 (file)
@@ -120,6 +120,8 @@ void StreamSocket::Close()
 {
        if (this->fd > -1)
        {
+               // final chance, dump as much of the sendq as we can
+               DoWrite();
                if (IOHook)
                {
                        try
@@ -131,6 +133,7 @@ void StreamSocket::Close()
                                ServerInstance->Logs->Log("SOCKET", DEFAULT,"%s threw an exception: %s",
                                        modexcept.GetSource(), modexcept.GetReason());
                        }
+                       IOHook = NULL;
                }
                ServerInstance->SE->Shutdown(this, 2);
                ServerInstance->SE->DelFd(this);