Skip to content

Commit 6634dc4

Browse files
bnoordhuisMylesBorins
authored andcommitted
src: fix -Wundefined-inline warnings
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]>
1 parent 0c6d9ae commit 6634dc4

4 files changed

+35
-26
lines changed

src/node_crypto.cc

+18
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,24 @@ int SSLWrap<Base>::SetCACerts(SecureContext* sc) {
28562856
}
28572857

28582858

2859+
Connection::Connection(Environment* env,
2860+
v8::Local<v8::Object> wrap,
2861+
SecureContext* sc,
2862+
SSLWrap<Connection>::Kind kind)
2863+
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
2864+
SSLWrap<Connection>(env, sc, kind),
2865+
bio_read_(nullptr),
2866+
bio_write_(nullptr),
2867+
hello_offset_(0) {
2868+
MakeWeak<Connection>(this);
2869+
Wrap(wrap, this);
2870+
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
2871+
OnClientHelloParseEnd,
2872+
this);
2873+
enable_session_callbacks();
2874+
}
2875+
2876+
28592877
void Connection::OnClientHelloParseEnd(void* arg) {
28602878
Connection* conn = static_cast<Connection*>(arg);
28612879

src/node_crypto.h

+1-13
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,7 @@ class Connection : public AsyncWrap, public SSLWrap<Connection> {
432432
Connection(Environment* env,
433433
v8::Local<v8::Object> wrap,
434434
SecureContext* sc,
435-
SSLWrap<Connection>::Kind kind)
436-
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
437-
SSLWrap<Connection>(env, sc, kind),
438-
bio_read_(nullptr),
439-
bio_write_(nullptr),
440-
hello_offset_(0) {
441-
MakeWeak<Connection>(this);
442-
Wrap(wrap, this);
443-
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
444-
OnClientHelloParseEnd,
445-
this);
446-
enable_session_callbacks();
447-
}
435+
SSLWrap<Connection>::Kind kind);
448436

449437
private:
450438
static void SSLInfoCallback(const SSL *ssl, int where, int ret);

src/node_crypto_clienthello-inl.h

+15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@
3030
namespace node {
3131
namespace crypto {
3232

33+
inline ClientHelloParser::ClientHelloParser()
34+
: state_(kEnded),
35+
onhello_cb_(nullptr),
36+
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) {
45+
Reset();
46+
}
47+
3348
inline void ClientHelloParser::Reset() {
3449
frame_len_ = 0;
3550
body_offset_ = 0;

src/node_crypto_clienthello.h

+1-13
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,7 @@ namespace crypto {
3333

3434
class ClientHelloParser {
3535
public:
36-
ClientHelloParser() : state_(kEnded),
37-
onhello_cb_(nullptr),
38-
onend_cb_(nullptr),
39-
cb_arg_(nullptr),
40-
session_size_(0),
41-
session_id_(nullptr),
42-
servername_size_(0),
43-
servername_(nullptr),
44-
ocsp_request_(0),
45-
tls_ticket_size_(0),
46-
tls_ticket_(nullptr) {
47-
Reset();
48-
}
36+
inline ClientHelloParser();
4937

5038
class ClientHello {
5139
public:

0 commit comments

Comments
 (0)