diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-10-03 23:15:15 +0300 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-10-05 14:33:41 +0300 |
commit | 1cc7b41ba4a5e2a05cddab12aa4e2d0f94ca0065 (patch) | |
tree | 86e3e644707bbddcb08909b7b5367877c8a1cc56 | |
parent | fb7a491d1c781c20e88b48214cda12a1048ee812 (diff) |
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
-rw-r--r-- | src/stream_wrap.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 120e2c4d502..e6236a6e529 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -313,7 +313,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; |