| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -515,6 +515,9 @@ function setupConnectionsTracking() { | |||
| 515 | 515 | this[kConnections] = new ConnectionsList(); | |
| 516 | 516 | } | |
| 517 | 517 | ||
| 518 | + if (this[kConnectionsCheckingInterval]) { | ||
| 519 | + clearInterval(this[kConnectionsCheckingInterval]); | ||
| 520 | + } | ||
| 518 | 521 | // This checker is started without checking whether any headersTimeout or requestTimeout is non zero | |
| 519 | 522 | // otherwise it would not be started if such timeouts are modified after createServer. | |
| 520 | 523 | this[kConnectionsCheckingInterval] = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const http = require('http'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + const { kConnectionsCheckingInterval } = require('_http_server'); | ||
| 6 | + | ||
| 7 | + let i = 0; | ||
| 8 | + let timer; | ||
| 9 | + const server = http.createServer(); | ||
| 10 | + server.on('listening', common.mustCall(() => { | ||
| 11 | + // If there was a timer, it must be destroyed | ||
| 12 | + if (timer) { | ||
| 13 | + assert.ok(timer._destroyed); | ||
| 14 | + } | ||
| 15 | + // Save the last timer | ||
| 16 | + timer = server[kConnectionsCheckingInterval]; | ||
| 17 | + if (++i === 2) { | ||
| 18 | + server.close(() => { | ||
| 19 | + assert.ok(timer._destroyed); | ||
| 20 | + }); | ||
| 21 | + } | ||
| 22 | + }, 2)); | ||
| 23 | + server.emit('listening'); | ||
| 24 | + server.emit('listening'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments