Skip to content
Permalink
Browse files

http2: use the latest settings

Fixes: #29764

PR-URL: #29780
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
ZYSzys authored and MylesBorins committed Oct 1, 2019
1 parent 7e941eb commit 20f64a96de07bd588e81f8813440181d50097cbe
Showing with 15 additions and 1 deletion.
  1. +1 −0 lib/internal/http2/core.js
  2. +14 −1 test/parallel/test-http2-session-settings.js
@@ -504,6 +504,7 @@ function onSettings() {
return;
session[kUpdateTimer]();
debugSessionObj(session, 'new settings received');
session[kRemoteSettings] = undefined;
session.emit('remoteSettings', session.remoteSettings);
}

@@ -38,6 +38,12 @@ server.on(
})
);

server.on('session', (session) => {
session.settings({
maxConcurrentStreams: 2
});
});

server.listen(
0,
common.mustCall(() => {
@@ -57,11 +63,18 @@ server.listen(
assert.strictEqual(settings.maxFrameSize, 16384);
}, 2)
);

let calledOnce = false;
client.on(
'remoteSettings',
common.mustCall((settings) => {
assert(settings);
})
assert.strictEqual(
settings.maxConcurrentStreams,
calledOnce ? 2 : (2 ** 32) - 1
);
calledOnce = true;
}, 2)
);

const headers = { ':path': '/' };

0 comments on commit 20f64a9

Please sign in to comment.
You can’t perform that action at this time.