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 21, 2015
1 parent 0064848 commit 8b54f40
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 @@ -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;
Expand Down

0 comments on commit 8b54f40

Please sign in to comment.