Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: rename CONNECTION provider to SSLCONNECTION #12989

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/async-wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace node {

#if HAVE_OPENSSL
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \
V(CONNECTION) \
V(SSLCONNECTION) \
V(PBKDF2REQUEST) \
V(RANDOMBYTESREQUEST) \
V(TLSWRAP)
Expand Down
2 changes: 1 addition & 1 deletion src/node_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class Connection : public AsyncWrap, public SSLWrap<Connection> {
v8::Local<v8::Object> wrap,
SecureContext* sc,
SSLWrap<Connection>::Kind kind)
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CONNECTION),
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
SSLWrap<Connection>(env, sc, kind),
bio_read_(nullptr),
bio_write_(nullptr),
Expand Down
12 changes: 6 additions & 6 deletions test/async-hooks/test-connection.ssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ function createServerConnection(
// creating first server connection
const sc1 = createServerConnection(common.mustCall(onfirstHandShake));

let as = hooks.activitiesOfTypes('CONNECTION');
let as = hooks.activitiesOfTypes('SSLCONNECTION');
assert.strictEqual(as.length, 1,
'one CONNECTION after first connection created');
const f1 = as[0];
assert.strictEqual(f1.type, 'CONNECTION', 'connection');
assert.strictEqual(f1.type, 'SSLCONNECTION', 'connection');
assert.strictEqual(typeof f1.uid, 'number', 'uid is a number');
assert.strictEqual(typeof f1.triggerId, 'number', 'triggerId is a number');
checkInvocations(f1, { init: 1 }, 'first connection, when first created');

// creating second server connection
const sc2 = createServerConnection(common.mustCall(onsecondHandShake));

as = hooks.activitiesOfTypes('CONNECTION');
as = hooks.activitiesOfTypes('SSLCONNECTION');
assert.strictEqual(as.length, 2,
'two CONNECTIONs after second connection created');
'two SSLCONNECTIONs after second connection created');
const f2 = as[1];
assert.strictEqual(f2.type, 'CONNECTION', 'connection');
assert.strictEqual(f2.type, 'SSLCONNECTION', 'connection');
assert.strictEqual(typeof f2.uid, 'number', 'uid is a number');
assert.strictEqual(typeof f2.triggerId, 'number', 'triggerId is a number');
checkInvocations(f1, { init: 1 }, 'first connection, when second created');
Expand Down Expand Up @@ -81,7 +81,7 @@ process.on('exit', onexit);

function onexit() {
hooks.disable();
hooks.sanityCheck('CONNECTION');
hooks.sanityCheck('SSLCONNECTION');

checkInvocations(f1, { init: 1, before: 1, after: 1 },
'first connection, when process exits');
Expand Down