| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 109ffcd commit 6794441
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -739,11 +739,18 @@ assignFunctionName(EE.captureRejectionSymbol, function(err, event, ...args) { | |||
| 739 | 739 | }); | |
| 740 | 740 | ||
| 741 | 741 | function checkConnections() { | |
| 742 | - if (this.headersTimeout === 0 && this.requestTimeout === 0) { | ||
| 742 | + const headersTimeout = | ||
| 743 | + NumberIsFinite(this.headersTimeout) && this.headersTimeout >= 0 ? | ||
| 744 | + this.headersTimeout : 0; | ||
| 745 | + const requestTimeout = | ||
| 746 | + NumberIsFinite(this.requestTimeout) && this.requestTimeout >= 0 ? | ||
| 747 | + this.requestTimeout : 0; | ||
| 748 | + | ||
| 749 | + if (headersTimeout === 0 && requestTimeout === 0) { | ||
| 743 | 750 | return; | |
| 744 | 751 | } | |
| 745 | 752 | ||
| 746 | - const expired = this[kConnections].expired(this.headersTimeout, this.requestTimeout); | ||
| 753 | + const expired = this[kConnections].expired(headersTimeout, requestTimeout); | ||
| 747 | 754 | ||
| 748 | 755 | for (let i = 0; i < expired.length; i++) { | |
| 749 | 756 | const socket = expired[i].socket; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + const { createServer } = require('http'); | ||
| 6 | + | ||
| 7 | + const server = createServer({ | ||
| 8 | + connectionsCheckingInterval: 1, | ||
| 9 | + }, common.mustNotCall()); | ||
| 10 | + | ||
| 11 | + // Invalid headersTimeout should not crash the server | ||
| 12 | + server.headersTimeout = 'im-not-a-number'; | ||
| 13 | + assert.strictEqual(server.headersTimeout, 'im-not-a-number'); | ||
| 14 | + | ||
| 15 | + server.listen(0, '127.0.0.1', common.mustCall(() => { | ||
| 16 | + setTimeout(common.mustCall(() => { | ||
| 17 | + server.close(common.mustCall()); | ||
| 18 | + }), common.platformTimeout(50)); | ||
| 19 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments