test: http2 connectionListener reject client

This code change modifies connectionListener tests to cover test case
where this.emit('unknownProtocol', socket) returns false

PR-URL: https://github.com/nodejs/node/pull/16080
Ref: https://github.com/nodejs/node/issues/14985
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Trivikram Kamat 2017-10-07 18:58:44 -07:00 committed by James M Snell
parent 727b5b63ef
commit 3cc725d9c6

View File

@ -110,9 +110,9 @@ function onSession(session) {
common.mustCall(onRequest)
);
server.on('unknownProtocol', common.mustCall((socket) => {
server.once('unknownProtocol', common.mustCall((socket) => {
socket.destroy();
}, 2));
}));
server.listen(0);