diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-12 02:17:42 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-12 02:17:42 +0000 |
commit | db8273d4e705a3127a654a77a22dc50482e21584 (patch) | |
tree | 9c335f72e6ec5a4aca72cf0296e469a635d3ad5c /src | |
parent | 170820cc8d09064742b6c2d3d716abac457cd880 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/inspsocket.cpp | 10 |
1 files 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) { |