stream_wrap: support empty TryWrites

Decrement `vcount` in `DoTryWrite` even if some of the buffers are
empty.

PR-URL: https://github.com/nodejs/node/pull/3128
This commit is contained in:
Fedor Indutny 2015-10-03 16:15:15 -04:00 committed by Rod Vagg
parent b3d96782d4
commit a4fa51cd02

View File

@ -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;