From db8273d4e705a3127a654a77a22dc50482e21584 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 12 Oct 2009 02:17:42 +0000 Subject: Correct the will-block prediction on partial writev() return git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11849 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index d98fa1b61..37335c855 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -361,6 +361,11 @@ void StreamSocket::DoWrite() else if (rv > 0) { // Partial write. Clean out strings from the sendq + if (rv < rv_max) + { + // it's going to block now + eventChange = FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK; + } sendq_len -= rv; while (rv > 0 && !sendq.empty()) { @@ -378,11 +383,6 @@ void StreamSocket::DoWrite() rv = 0; } } - if (rv < rv_max) - { - // it's going to block now - eventChange = FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK; - } } else if (rv == 0) { -- cgit v1.2.3