From cbe92390c14f0fffdb7e86a3d866887ff12242e2 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 225103cc8d727a..6807c6a32ee135 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);