Skip to content

Commit

Permalink
src: use DoTryWrite() for not-all-Buffer writev()s too
Browse files Browse the repository at this point in the history
PR-URL: #18019
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and MylesBorins committed Aug 17, 2018
1 parent 2ec981b commit cbe9239
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ int StreamBase::Writev(const FunctionCallbackInfo<Value>& args) {
offset += str_size;
bytes += str_size;
}

err = DoTryWrite(&buf_list, &count);
if (err != 0 || count == 0) {
req_wrap->Dispatched();
req_wrap->Dispose();
goto done;
}
}

err = DoWrite(req_wrap, buf_list, count, nullptr);
Expand Down

0 comments on commit cbe9239

Please sign in to comment.