Skip to content

Commit 4d00cd4

Browse files
committed
tls: move convertNPNProtocols to End-of-Life
This was deprecated in 10.0.0 because NPN support was removed. It does not make sense to keep this around longer than 10.x PR-URL: #20736 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 8d38288 commit 4d00cd4

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

benchmark/tls/convertprotocols.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ function main({ n }) {
1212
var m = {};
1313
// First call dominates results
1414
if (n > 1) {
15-
tls.convertNPNProtocols(input, m);
15+
tls.convertALPNProtocols(input, m);
1616
m = {};
1717
}
1818
bench.start();
1919
for (var i = 0; i < n; i++)
20-
tls.convertNPNProtocols(input, m);
20+
tls.convertALPNProtocols(input, m);
2121
bench.end(n);
2222
}

doc/api/deprecations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ objects respectively.
977977
<a id="DEP0107"></a>
978978
### DEP0107: tls.convertNPNProtocols()
979979
980-
Type: Runtime
980+
Type: End-of-Life
981981
982982
This was an undocumented helper function not intended for use outside Node.js
983983
core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.

lib/tls.js

-10
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ function convertProtocols(protocols) {
7676
return buff;
7777
}
7878

79-
exports.convertNPNProtocols = internalUtil.deprecate(function(protocols, out) {
80-
// If protocols is Array - translate it into buffer
81-
if (Array.isArray(protocols)) {
82-
out.NPNProtocols = convertProtocols(protocols);
83-
} else if (isUint8Array(protocols)) {
84-
// Copy new buffer not to be modified by user.
85-
out.NPNProtocols = Buffer.from(protocols);
86-
}
87-
}, 'tls.convertNPNProtocols() is deprecated.', 'DEP0107');
88-
8979
exports.convertALPNProtocols = function(protocols, out) {
9080
// If protocols is Array - translate it into buffer
9181
if (Array.isArray(protocols)) {

test/parallel/test-tls-basic-validations.js

-16
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,9 @@ common.expectsError(
9393
assert(out.ALPNProtocols.equals(Buffer.from('efgh')));
9494
}
9595

96-
{
97-
const buffer = Buffer.from('abcd');
98-
const out = {};
99-
tls.convertNPNProtocols(buffer, out);
100-
out.NPNProtocols.write('efgh');
101-
assert(buffer.equals(Buffer.from('abcd')));
102-
assert(out.NPNProtocols.equals(Buffer.from('efgh')));
103-
}
104-
10596
{
10697
const buffer = new Uint8Array(Buffer.from('abcd'));
10798
const out = {};
10899
tls.convertALPNProtocols(buffer, out);
109100
assert(out.ALPNProtocols.equals(Buffer.from('abcd')));
110101
}
111-
112-
{
113-
const buffer = new Uint8Array(Buffer.from('abcd'));
114-
const out = {};
115-
tls.convertNPNProtocols(buffer, out);
116-
assert(out.NPNProtocols.equals(Buffer.from('abcd')));
117-
}

0 commit comments

Comments
 (0)