-
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.
https: fix connection checking interval not clearing on server close
The connection interval should close when httpsServer.close is called similarly to how it gets cleared when httpServer.close is called. Fixes: #48373 PR-URL: #48383 Backport-PR-URL: #50194 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
- Loading branch information
Showing
6 changed files
with
52 additions
and
3 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
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,13 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { createServer } = require('http'); | ||
const { kConnectionsCheckingInterval } = require('_http_server'); | ||
|
||
const server = createServer(function(req, res) {}); | ||
server.listen(0, common.mustCall(function() { | ||
assert.strictEqual(server[kConnectionsCheckingInterval]._destroyed, false); | ||
server.close(common.mustCall(() => { | ||
assert(server[kConnectionsCheckingInterval]._destroyed); | ||
})); | ||
})); |
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,24 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
if (!common.hasCrypto) { | ||
common.skip('missing crypto'); | ||
} | ||
|
||
const { createServer } = require('https'); | ||
const { kConnectionsCheckingInterval } = require('_http_server'); | ||
|
||
const fixtures = require('../common/fixtures'); | ||
|
||
const options = { | ||
key: fixtures.readKey('agent1-key.pem'), | ||
cert: fixtures.readKey('agent1-cert.pem') | ||
}; | ||
|
||
const server = createServer(options, function(req, res) {}); | ||
server.listen(0, common.mustCall(function() { | ||
assert.strictEqual(server[kConnectionsCheckingInterval]._destroyed, false); | ||
server.close(common.mustCall(() => { | ||
assert(server[kConnectionsCheckingInterval]._destroyed); | ||
})); | ||
})); |
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