Skip to content

Commit 60f0dc7

Browse files
committed
src: rename CONNECTION provider to SSLCONNECTION
Currently the async provider type CONNECTION is used in node_crypto.h and it might be clearer if it was named SSLCONNECTION as suggested by addaleax. This commit renames only the provider type as I was not sure if it was alright to change the class Connection as well. Refs: #12967 (comment) PR-URL: #12989 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 72e3dda commit 60f0dc7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/async-wrap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace node {
6060

6161
#if HAVE_OPENSSL
6262
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \
63-
V(CONNECTION) \
63+
V(SSLCONNECTION) \
6464
V(PBKDF2REQUEST) \
6565
V(RANDOMBYTESREQUEST) \
6666
V(TLSWRAP)

src/node_crypto.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ class Connection : public AsyncWrap, public SSLWrap<Connection> {
402402
v8::Local<v8::Object> wrap,
403403
SecureContext* sc,
404404
SSLWrap<Connection>::Kind kind)
405-
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CONNECTION),
405+
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_SSLCONNECTION),
406406
SSLWrap<Connection>(env, sc, kind),
407407
bio_read_(nullptr),
408408
bio_write_(nullptr),

test/async-hooks/test-connection.ssl.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ function createServerConnection(
3737
// creating first server connection
3838
const sc1 = createServerConnection(common.mustCall(onfirstHandShake));
3939

40-
let as = hooks.activitiesOfTypes('CONNECTION');
40+
let as = hooks.activitiesOfTypes('SSLCONNECTION');
4141
assert.strictEqual(as.length, 1,
4242
'one CONNECTION after first connection created');
4343
const f1 = as[0];
44-
assert.strictEqual(f1.type, 'CONNECTION', 'connection');
44+
assert.strictEqual(f1.type, 'SSLCONNECTION', 'connection');
4545
assert.strictEqual(typeof f1.uid, 'number', 'uid is a number');
4646
assert.strictEqual(typeof f1.triggerId, 'number', 'triggerId is a number');
4747
checkInvocations(f1, { init: 1 }, 'first connection, when first created');
4848

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

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

8282
function onexit() {
8383
hooks.disable();
84-
hooks.sanityCheck('CONNECTION');
84+
hooks.sanityCheck('SSLCONNECTION');
8585

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

0 commit comments

Comments
 (0)