summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-01 00:46:25 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-01 00:46:25 +0000
commitaca3ddf2307fd69c1fe0a396084d1f8ff758af26 (patch)
tree198778a16cb681be25c01925ae614c63aa6b06be
parentce04e74ea53d6e649dc90e97118d9a58155f9d94 (diff)
Correctly abort attempted socket writes on error
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12340 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspsocket.cpp4
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();