Skip to content

Commit

Permalink
crypto: move field initialization to class
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Diana Holland authored and MylesBorins committed Oct 30, 2018
1 parent 6af2f9f commit 86a5690
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
9 changes: 1 addition & 8 deletions src/node_crypto_clienthello-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ inline ClientHelloParser::ClientHelloParser()
: state_(kEnded),
onhello_cb_(nullptr),
onend_cb_(nullptr),
cb_arg_(nullptr),
session_size_(0),
session_id_(nullptr),
servername_size_(0),
servername_(nullptr),
ocsp_request_(0),
tls_ticket_size_(0),
tls_ticket_(nullptr) {
cb_arg_(nullptr) {
Reset();
}

Expand Down
20 changes: 10 additions & 10 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ class ClientHelloParser {
OnHelloCb onhello_cb_;
OnEndCb onend_cb_;
void* cb_arg_;
size_t frame_len_;
size_t body_offset_;
size_t extension_offset_;
uint8_t session_size_;
const uint8_t* session_id_;
uint16_t servername_size_;
const uint8_t* servername_;
uint8_t ocsp_request_;
uint16_t tls_ticket_size_;
const uint8_t* tls_ticket_;
size_t frame_len_ = 0;
size_t body_offset_ = 0;
size_t extension_offset_ = 0;
uint8_t session_size_ = 0;
const uint8_t* session_id_ = nullptr;
uint16_t servername_size_ = 0;
const uint8_t* servername_ = nullptr;
uint8_t ocsp_request_ = 0;
uint16_t tls_ticket_size_ = -1;
const uint8_t* tls_ticket_ = nullptr;
};

} // namespace crypto
Expand Down

0 comments on commit 86a5690

Please sign in to comment.