From cb5ccf6a7a67c5c4e864dad98d0e0b149e5fecd2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 8 Mar 2015 21:15:12 +0900 Subject: [PATCH] SocketBuffer: Keep sending until blocked See GH-345 --- src/SocketBuffer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SocketBuffer.cc b/src/SocketBuffer.cc index 0a09f2ae..f941df90 100644 --- a/src/SocketBuffer.cc +++ b/src/SocketBuffer.cc @@ -169,7 +169,10 @@ ssize_t SocketBuffer::send() if(firstlen > slen) { offset_ += slen; bufq_.front()->progressUpdate(slen, false); - goto fin; + if (socket_->wantRead() || socket_->wantWrite()) { + goto fin; + } + continue; } slen -= firstlen;