-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http2: fix session[kSession] undefined issue
`finishSessionDestroy` session cleanup when already done. PR-URL: #24547 Fixes: #24546 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
const h2 = require('http2'); | ||
|
||
const server = h2.createServer(); | ||
server.listen(0, common.localhostIPv4, common.mustCall(() => { | ||
const afterConnect = common.mustCall((session) => { | ||
session.request({ ':method': 'POST' }).end(common.mustCall(() => { | ||
session.destroy(); | ||
server.close(); | ||
})); | ||
}); | ||
|
||
const port = server.address().port; | ||
const host = common.localhostIPv4; | ||
h2.connect('http://' + host + ':' + port, afterConnect); | ||
})); |