Skip to content

Commit e84a7f0

Browse files
richardhoehnjasnell
authored andcommitted
src: add default initializer in tls_wrap
PR-URL: #23567 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent d49937a commit e84a7f0

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/tls_wrap.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ TLSWrap::TLSWrap(Environment* env,
5858
AsyncWrap::PROVIDER_TLSWRAP),
5959
SSLWrap<TLSWrap>(env, sc, kind),
6060
StreamBase(env),
61-
sc_(sc),
62-
write_size_(0),
63-
started_(false),
64-
established_(false),
65-
shutdown_(false),
66-
cycle_depth_(0),
67-
eof_(false) {
61+
sc_(sc) {
6862
MakeWeak();
6963

7064
// sc comes from an Unwrap. Make sure it was assigned.

src/tls_wrap.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@ class TLSWrap : public AsyncWrap,
149149
BIO* enc_in_ = nullptr;
150150
BIO* enc_out_ = nullptr;
151151
std::vector<uv_buf_t> pending_cleartext_input_;
152-
size_t write_size_;
152+
size_t write_size_ = 0;
153153
WriteWrap* current_write_ = nullptr;
154154
WriteWrap* current_empty_write_ = nullptr;
155155
bool write_callback_scheduled_ = false;
156-
bool started_;
157-
bool established_;
158-
bool shutdown_;
156+
bool started_ = false;
157+
bool established_ = false;
158+
bool shutdown_ = false;
159159
std::string error_;
160-
int cycle_depth_;
160+
int cycle_depth_ = 0;
161161

162162
// If true - delivered EOF to the js-land, either after `close_notify`, or
163163
// after the `UV_EOF` on socket.
164-
bool eof_;
164+
bool eof_ = false;
165165

166166
private:
167167
static void GetWriteQueueSize(

0 commit comments

Comments
 (0)