From a627c5fc136b3233959e8e1bff90ae4b2d0ec322 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Thu, 12 Oct 2017 06:57:42 -0700 Subject: net: fix timeouts during long writes Add updateWriteQueueSize which updates and returns queue size (net & tls). Make _onTimeout check whether an active write is ongoing and if so, call _unrefTimer rather than emitting a timeout event. Add http & https test that checks whether long-lasting (but active) writes timeout or can finish writing as expected. PR-URL: https://github.com/nodejs/node/pull/15791 Fixes: https://github.com/nodejs/node/issues/15082 Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Refael Ackermann Reviewed-By: Fedor Indutny --- src/tls_wrap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tls_wrap.h') diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 8d75d6fcc9..99d2dc9121 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -188,6 +188,10 @@ class TLSWrap : public AsyncWrap, // If true - delivered EOF to the js-land, either after `close_notify`, or // after the `UV_EOF` on socket. bool eof_; + + private: + static void UpdateWriteQueueSize( + const v8::FunctionCallbackInfo& args); }; } // namespace node -- cgit v1.2.3