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 authored and James M Snell committed 2017-10-15 15:02:04 -07:00
1 parent 727b5b63ef
commit 3cc725d9c6
1 file changed
+2 -2
+2 -2
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);