]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Allow opermotd to specify its file in <files> without also requiring an <opermotd...
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index 5099df88201016c68a2e68745604ba218c052f24..1fbe3b5abbc9fed6866dc098058437b38cce7ce8 100644 (file)
@@ -118,11 +118,6 @@ BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs&
 
 void StreamSocket::Close()
 {
-       /* Save this, so we dont lose it,
-        * otherise on failure, error messages
-        * might be inaccurate.
-        */
-       int save = errno;
        if (this->fd > -1)
        {
                if (IOHook)
@@ -142,7 +137,6 @@ void StreamSocket::Close()
                ServerInstance->SE->Close(this);
                fd = -1;
        }
-       errno = save;
 }
 
 CullResult StreamSocket::cull()
@@ -236,7 +230,7 @@ void StreamSocket::DoWrite()
                int rv = -1;
                try
                {
-                       while (!sendq.empty())
+                       while (error.empty() && !sendq.empty())
                        {
                                if (sendq.size() > 1 && sendq[0].length() < 1024)
                                {
@@ -329,7 +323,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();