Ver código fonte

SocketBuffer: Keep sending until blocked

See GH-345
Tatsuhiro Tsujikawa 10 anos atrás
pai
commit
cb5ccf6a7a
1 arquivos alterados com 4 adições e 1 exclusões
  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;