Skip to content

Commit 8b54f40

Browse files
indutnyrvagg
authored andcommitted
stream_wrap: support empty TryWrites
Decrement `vcount` in `DoTryWrite` even if some of the buffers are empty. PR-URL: nodejs#3128
1 parent 0064848 commit 8b54f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stream_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int StreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) {
314314
// Slice off the buffers: skip all written buffers and slice the one that
315315
// was partially written.
316316
written = err;
317-
for (; written != 0 && vcount > 0; vbufs++, vcount--) {
317+
for (; vcount > 0; vbufs++, vcount--) {
318318
// Slice
319319
if (vbufs[0].len > written) {
320320
vbufs[0].base += written;

0 commit comments

Comments
 (0)