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 <jasnell@gmail.com>
  • Loading branch information
addaleax committed Jan 14, 2018
1 parent 20f6aae commit 02fef8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stream_base.cc
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 02fef8a

Please sign in to comment.