Skip to content

Commit

Permalink
src: fix -Wundefined-inline warnings
Browse files Browse the repository at this point in the history
Fix compiler warnings introduced in commit 47edfd9 ("crypto: move
node_crypto_clienthello-inl.h to cc") by moving constructors around.

They were defined inline but depended on definitions
from `node_crypto_clienthello-inl.h`.

PR-URL: #17649
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Jan 8, 2018
1 parent 0c6d9ae commit 6634dc4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
18 changes: 18 additions & 0 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,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);

Expand Down
14 changes: 1 addition & 13 deletions src/node_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions src/node_crypto_clienthello-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 1 addition & 13 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6634dc4

Please sign in to comment.