]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Fix FIDENT response forging to run prior to the ENCAP strip
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index 652799b9cd640244812087e0bb326bcf43469a37..f06ddf28d84d1ef96b6fec587cc6ff193b5b8229 100644 (file)
@@ -131,6 +131,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);
@@ -230,7 +231,7 @@ void StreamSocket::DoWrite()
                int rv = -1;
                try
                {
-                       while (!sendq.empty())
+                       while (error.empty() && !sendq.empty())
                        {
                                if (sendq.size() > 1 && sendq[0].length() < 1024)
                                {
@@ -323,7 +324,7 @@ void StreamSocket::DoWrite()
                        return;
                // start out optimistic - we won't need to write any more
                int eventChange = FD_WANT_EDGE_WRITE;
-               while (sendq_len && eventChange == FD_WANT_EDGE_WRITE)
+               while (error.empty() && sendq_len && eventChange == FD_WANT_EDGE_WRITE)
                {
                        // Prepare a writev() call to write all buffers efficiently
                        int bufcount = sendq.size();