diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-01 00:46:25 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-01 00:46:25 +0000 |
commit | aca3ddf2307fd69c1fe0a396084d1f8ff758af26 (patch) | |
tree | 198778a16cb681be25c01925ae614c63aa6b06be /src/inspsocket.cpp | |
parent | ce04e74ea53d6e649dc90e97118d9a58155f9d94 (diff) |
Correctly abort attempted socket writes on error
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12340 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r-- | src/inspsocket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 652799b9c..1fbe3b5ab 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -230,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) { @@ -323,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(); |