aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/node_crypto.cc18
-rw-r--r--src/node_crypto.h14
-rw-r--r--src/node_crypto_clienthello-inl.h15
-rw-r--r--src/node_crypto_clienthello.h14
4 files changed, 35 insertions, 26 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 614c1067c6..480be4dd15 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2849,6 +2849,24 @@ int SSLWrap<Base>::SetCACerts(SecureContext* sc) {
}
+Connection::Connection(Environment* env,
+ v8::Local<v8::Object> wrap,
+ SecureContext* sc,
+ SSLWrap<Connection>::Kind kind)
+ : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
+ SSLWrap<Connection>(env, sc, kind),
+ bio_read_(nullptr),
+ bio_write_(nullptr),
+ hello_offset_(0) {
+ MakeWeak<Connection>(this);
+ Wrap(wrap, this);
+ hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
+ OnClientHelloParseEnd,
+ this);
+ enable_session_callbacks();
+}
+
+
void Connection::OnClientHelloParseEnd(void* arg) {
Connection* conn = static_cast<Connection*>(arg);
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 636cbb99d4..463be5f072 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -432,19 +432,7 @@ class Connection : public AsyncWrap, public SSLWrap<Connection> {
Connection(Environment* env,
v8::Local<v8::Object> wrap,
SecureContext* sc,
- SSLWrap<Connection>::Kind kind)
- : AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
- SSLWrap<Connection>(env, sc, kind),
- bio_read_(nullptr),
- bio_write_(nullptr),
- hello_offset_(0) {
- MakeWeak<Connection>(this);
- Wrap(wrap, this);
- hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
- OnClientHelloParseEnd,
- this);
- enable_session_callbacks();
- }
+ SSLWrap<Connection>::Kind kind);
private:
static void SSLInfoCallback(const SSL *ssl, int where, int ret);
diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h
index 019d7188de..5aff1816b2 100644
--- a/src/node_crypto_clienthello-inl.h
+++ b/src/node_crypto_clienthello-inl.h
@@ -30,6 +30,21 @@
namespace node {
namespace crypto {
+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) {
+ Reset();
+}
+
inline void ClientHelloParser::Reset() {
frame_len_ = 0;
body_offset_ = 0;
diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h
index 70f082b2c2..32c470677d 100644
--- a/src/node_crypto_clienthello.h
+++ b/src/node_crypto_clienthello.h
@@ -33,19 +33,7 @@ namespace crypto {
class ClientHelloParser {
public:
- 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) {
- Reset();
- }
+ inline ClientHelloParser();
class ClientHello {
public: