Skip to content

Commit

Permalink
stream_wrap: support empty TryWrites
Browse files Browse the repository at this point in the history
Decrement `vcount` in `DoTryWrite` even if some of the buffers are
empty.

PR-URL: #3128
  • Loading branch information
indutny authored and rvagg committed Oct 5, 2015
1 parent b3d9678 commit a4fa51c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a4fa51c

Please sign in to comment.