Skip to content

Commit 6a989da

Browse files
ZYSzysBridgeAR
authored andcommittedOct 9, 2019
http2: use the latest settings
Fixes: #29764 PR-URL: #29780 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 014eb67 commit 6a989da

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

‎lib/internal/http2/core.js

+1
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ function onSettings() {
518518
return;
519519
session[kUpdateTimer]();
520520
debugSessionObj(session, 'new settings received');
521+
session[kRemoteSettings] = undefined;
521522
session.emit('remoteSettings', session.remoteSettings);
522523
}
523524

‎test/parallel/test-http2-session-settings.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ server.on(
3838
})
3939
);
4040

41+
server.on('session', (session) => {
42+
session.settings({
43+
maxConcurrentStreams: 2
44+
});
45+
});
46+
4147
server.listen(
4248
0,
4349
common.mustCall(() => {
@@ -57,11 +63,18 @@ server.listen(
5763
assert.strictEqual(settings.maxFrameSize, 16384);
5864
}, 2)
5965
);
66+
67+
let calledOnce = false;
6068
client.on(
6169
'remoteSettings',
6270
common.mustCall((settings) => {
6371
assert(settings);
64-
})
72+
assert.strictEqual(
73+
settings.maxConcurrentStreams,
74+
calledOnce ? 2 : (2 ** 32) - 1
75+
);
76+
calledOnce = true;
77+
}, 2)
6578
);
6679

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

0 commit comments

Comments
 (0)
Please sign in to comment.