From 8b54f401adecd90fb229432e230e3f9a3b6256cc Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 3 Oct 2015 16:15:15 -0400 Subject: [PATCH] stream_wrap: support empty `TryWrite`s Decrement `vcount` in `DoTryWrite` even if some of the buffers are empty. PR-URL: https://github.com/nodejs/node/pull/3128 --- src/stream_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index ec98acbb30bb4a..03ca9e04e3a754 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -314,7 +314,7 @@ int StreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) { // Slice off the buffers: skip all written buffers and slice the one that // was partially written. written = err; - for (; written != 0 && vcount > 0; vbufs++, vcount--) { + for (; vcount > 0; vbufs++, vcount--) { // Slice if (vbufs[0].len > written) { vbufs[0].base += written;