From aca3ddf2307fd69c1fe0a396084d1f8ff758af26 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 1 Feb 2010 00:46:25 +0000 Subject: Correctly abort attempted socket writes on error git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12340 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/inspsocket.cpp') 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(); -- cgit v1.2.3