From 45ef905585266504633dc4ba020b9caaea938839 Mon Sep 17 00:00:00 2001 From: Richard Hoehn Date: Fri, 12 Oct 2018 11:07:52 -0700 Subject: [PATCH] src: add default initializer in tls_wrap PR-URL: https://github.com/nodejs/node/pull/23567 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- src/tls_wrap.cc | 8 +------- src/tls_wrap.h | 12 ++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 3dbeabd891ad20..6bc152b2e24fca 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -58,13 +58,7 @@ TLSWrap::TLSWrap(Environment* env, AsyncWrap::PROVIDER_TLSWRAP), SSLWrap(env, sc, kind), StreamBase(env), - sc_(sc), - write_size_(0), - started_(false), - established_(false), - shutdown_(false), - cycle_depth_(0), - eof_(false) { + sc_(sc) { MakeWeak(); // sc comes from an Unwrap. Make sure it was assigned. diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 0e265764822f29..4c47cd81197189 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -149,19 +149,19 @@ class TLSWrap : public AsyncWrap, BIO* enc_in_ = nullptr; BIO* enc_out_ = nullptr; std::vector pending_cleartext_input_; - size_t write_size_; + size_t write_size_ = 0; WriteWrap* current_write_ = nullptr; WriteWrap* current_empty_write_ = nullptr; bool write_callback_scheduled_ = false; - bool started_; - bool established_; - bool shutdown_; + bool started_ = false; + bool established_ = false; + bool shutdown_ = false; std::string error_; - int cycle_depth_; + int cycle_depth_ = 0; // If true - delivered EOF to the js-land, either after `close_notify`, or // after the `UV_EOF` on socket. - bool eof_; + bool eof_ = false; private: static void GetWriteQueueSize(