From f60757796b3971bdfe124aa9fb3c469c1cf351e2 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 10 Jan 2018 20:39:05 +0100 Subject: [PATCH] src: use `DoTryWrite()` for not-all-Buffer writev()s too PR-URL: https://github.com/nodejs/node/pull/18019 Reviewed-By: James M Snell --- src/stream_base.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stream_base.cc b/src/stream_base.cc index ecb5f3dd1b954e..0fb801ddd57445 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -192,6 +192,13 @@ int StreamBase::Writev(const FunctionCallbackInfo& 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);