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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
8d38288a80
commit
4d00cd4ce7
@ -12,11 +12,11 @@ function main({ n }) {
|
||||
var m = {};
|
||||
// First call dominates results
|
||||
if (n > 1) {
|
||||
tls.convertNPNProtocols(input, m);
|
||||
tls.convertALPNProtocols(input, m);
|
||||
m = {};
|
||||
}
|
||||
bench.start();
|
||||
for (var i = 0; i < n; i++)
|
||||
tls.convertNPNProtocols(input, m);
|
||||
tls.convertALPNProtocols(input, m);
|
||||
bench.end(n);
|
||||
}
|
||||
|
@ -977,7 +977,7 @@ objects respectively.
|
||||
<a id="DEP0107"></a>
|
||||
### DEP0107: tls.convertNPNProtocols()
|
||||
|
||||
Type: Runtime
|
||||
Type: End-of-Life
|
||||
|
||||
This was an undocumented helper function not intended for use outside Node.js
|
||||
core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.
|
||||
|
10
lib/tls.js
10
lib/tls.js
@ -76,16 +76,6 @@ function convertProtocols(protocols) {
|
||||
return buff;
|
||||
}
|
||||
|
||||
exports.convertNPNProtocols = internalUtil.deprecate(function(protocols, out) {
|
||||
// If protocols is Array - translate it into buffer
|
||||
if (Array.isArray(protocols)) {
|
||||
out.NPNProtocols = convertProtocols(protocols);
|
||||
} else if (isUint8Array(protocols)) {
|
||||
// Copy new buffer not to be modified by user.
|
||||
out.NPNProtocols = Buffer.from(protocols);
|
||||
}
|
||||
}, 'tls.convertNPNProtocols() is deprecated.', 'DEP0107');
|
||||
|
||||
exports.convertALPNProtocols = function(protocols, out) {
|
||||
// If protocols is Array - translate it into buffer
|
||||
if (Array.isArray(protocols)) {
|
||||
|
@ -93,25 +93,9 @@ common.expectsError(
|
||||
assert(out.ALPNProtocols.equals(Buffer.from('efgh')));
|
||||
}
|
||||
|
||||
{
|
||||
const buffer = Buffer.from('abcd');
|
||||
const out = {};
|
||||
tls.convertNPNProtocols(buffer, out);
|
||||
out.NPNProtocols.write('efgh');
|
||||
assert(buffer.equals(Buffer.from('abcd')));
|
||||
assert(out.NPNProtocols.equals(Buffer.from('efgh')));
|
||||
}
|
||||
|
||||
{
|
||||
const buffer = new Uint8Array(Buffer.from('abcd'));
|
||||
const out = {};
|
||||
tls.convertALPNProtocols(buffer, out);
|
||||
assert(out.ALPNProtocols.equals(Buffer.from('abcd')));
|
||||
}
|
||||
|
||||
{
|
||||
const buffer = new Uint8Array(Buffer.from('abcd'));
|
||||
const out = {};
|
||||
tls.convertNPNProtocols(buffer, out);
|
||||
assert(out.NPNProtocols.equals(Buffer.from('abcd')));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user