Skip to content

Commit ed0070e

Browse files
Diana Hollandjasnell
Diana Holland
authored andcommitted
crypto: move field initialization to class
PR-URL: #23610 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
1 parent 74ebfa3 commit ed0070e

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

src/node_crypto_clienthello-inl.h

+1-8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ inline ClientHelloParser::ClientHelloParser()
3434
: state_(kEnded),
3535
onhello_cb_(nullptr),
3636
onend_cb_(nullptr),
37-
cb_arg_(nullptr),
38-
session_size_(0),
39-
session_id_(nullptr),
40-
servername_size_(0),
41-
servername_(nullptr),
42-
ocsp_request_(0),
43-
tls_ticket_size_(0),
44-
tls_ticket_(nullptr) {
37+
cb_arg_(nullptr) {
4538
Reset();
4639
}
4740

src/node_crypto_clienthello.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ class ClientHelloParser {
108108
OnHelloCb onhello_cb_;
109109
OnEndCb onend_cb_;
110110
void* cb_arg_;
111-
size_t frame_len_;
112-
size_t body_offset_;
113-
size_t extension_offset_;
114-
uint8_t session_size_;
115-
const uint8_t* session_id_;
116-
uint16_t servername_size_;
117-
const uint8_t* servername_;
118-
uint8_t ocsp_request_;
119-
uint16_t tls_ticket_size_;
120-
const uint8_t* tls_ticket_;
111+
size_t frame_len_ = 0;
112+
size_t body_offset_ = 0;
113+
size_t extension_offset_ = 0;
114+
uint8_t session_size_ = 0;
115+
const uint8_t* session_id_ = nullptr;
116+
uint16_t servername_size_ = 0;
117+
const uint8_t* servername_ = nullptr;
118+
uint8_t ocsp_request_ = 0;
119+
uint16_t tls_ticket_size_ = -1;
120+
const uint8_t* tls_ticket_ = nullptr;
121121
};
122122

123123
} // namespace crypto

0 commit comments

Comments
 (0)