浏览代码

SocketBuffer: Keep sending until blocked

See GH-345
Tatsuhiro Tsujikawa 10 年之前
父节点
当前提交
cb5ccf6a7a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/SocketBuffer.cc

+ 4 - 1
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;