| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e582d11 commit c30ef3c
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1013,9 +1013,13 @@ Limits maximum incoming headers count. If set to 0, no limit will be applied. | |||
| 1013 | 1013 | ### server.setTimeout([msecs][, callback]) | |
| 1014 | 1014 | <!-- YAML | |
| 1015 | 1015 | added: v0.9.12 | |
| 1016 | + changes: | ||
| 1017 | + - version: REPLACEME | ||
| 1018 | + pr-url: https://github.com/nodejs/node/pull/27558 | ||
| 1019 | + description: The default timeout changed from 120s to 0 (no timeout). | ||
| 1016 | 1020 | --> | |
| 1017 | 1021 | ||
| 1018 | - * `msecs` {number} **Default:** `120000` (2 minutes) | ||
| 1022 | + * `msecs` {number} **Default:** 0 (no timeout) | ||
| 1019 | 1023 | * `callback` {Function} | |
| 1020 | 1024 | * Returns: {http.Server} | |
| 1021 | 1025 | ||
@@ -1026,16 +1030,20 @@ occurs. | |||
| 1026 | 1030 | If there is a `'timeout'` event listener on the Server object, then it | |
| 1027 | 1031 | will be called with the timed-out socket as an argument. | |
| 1028 | 1032 | ||
| 1029 | - By default, the Server's timeout value is 2 minutes, and sockets are | ||
| 1030 | - destroyed automatically if they time out. However, if a callback is assigned | ||
| 1031 | - to the Server's `'timeout'` event, timeouts must be handled explicitly. | ||
| 1033 | + By default, the Server does not timeout sockets. However, if a callback | ||
| 1034 | + is assigned to the Server's `'timeout'` event, timeouts must be handled | ||
| 1035 | + explicitly. | ||
| 1032 | 1036 | ||
| 1033 | 1037 | ### server.timeout | |
| 1034 | 1038 | <!-- YAML | |
| 1035 | 1039 | added: v0.9.12 | |
| 1040 | + changes: | ||
| 1041 | + - version: REPLACEME | ||
| 1042 | + pr-url: https://github.com/nodejs/node/pull/27558 | ||
| 1043 | + description: The default timeout changed from 120s to 0 (no timeout). | ||
| 1036 | 1044 | --> | |
| 1037 | 1045 | ||
| 1038 | - * {number} Timeout in milliseconds. **Default:** `120000` (2 minutes). | ||
| 1046 | + * {number} Timeout in milliseconds. **Default:** 0 (no timeout) | ||
| 1039 | 1047 | ||
| 1040 | 1048 | The number of milliseconds of inactivity before a socket is presumed | |
| 1041 | 1049 | to have timed out. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1722,11 +1722,15 @@ server.on('stream', (stream, headers, flags) => { | |||
| 1722 | 1722 | #### Event: 'timeout' | |
| 1723 | 1723 | <!-- YAML | |
| 1724 | 1724 | added: v8.4.0 | |
| 1725 | + changes: | ||
| 1726 | + - version: REPLACEME | ||
| 1727 | + pr-url: https://github.com/nodejs/node/pull/27558 | ||
| 1728 | + description: The default timeout changed from 120s to 0 (no timeout). | ||
| 1725 | 1729 | --> | |
| 1726 | 1730 | ||
| 1727 | 1731 | The `'timeout'` event is emitted when there is no activity on the Server for | |
| 1728 | 1732 | a given number of milliseconds set using `http2server.setTimeout()`. | |
| 1729 | - **Default:** 2 minutes. | ||
| 1733 | + **Default:** 0 (no timeout) | ||
| 1730 | 1734 | ||
| 1731 | 1735 | #### server.close([callback]) | |
| 1732 | 1736 | <!-- YAML | |
@@ -1743,9 +1747,13 @@ consider also using [`http2session.close()`] on active sessions. | |||
| 1743 | 1747 | #### server.setTimeout([msecs][, callback]) | |
| 1744 | 1748 | <!-- YAML | |
| 1745 | 1749 | added: v8.4.0 | |
| 1750 | + changes: | ||
| 1751 | + - version: REPLACEME | ||
| 1752 | + pr-url: https://github.com/nodejs/node/pull/27558 | ||
| 1753 | + description: The default timeout changed from 120s to 0 (no timeout). | ||
| 1746 | 1754 | --> | |
| 1747 | 1755 | ||
| 1748 | - * `msecs` {number} **Default:** `120000` (2 minutes) | ||
| 1756 | + * `msecs` {number} **Default:** 0 (no timeout) | ||
| 1749 | 1757 | * `callback` {Function} | |
| 1750 | 1758 | * Returns: {Http2Server} | |
| 1751 | 1759 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -315,7 +315,7 @@ function Server(options, requestListener) { | |||
| 315 | 315 | ||
| 316 | 316 | this.on('connection', connectionListener); | |
| 317 | 317 | ||
| 318 | - this.timeout = 2 * 60 * 1000; | ||
| 318 | + this.timeout = 0; | ||
| 319 | 319 | this.keepAliveTimeout = 5000; | |
| 320 | 320 | this.maxHeadersCount = null; | |
| 321 | 321 | this.headersTimeout = 40 * 1000; // 40 seconds | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,7 +71,7 @@ function Server(opts, requestListener) { | |||
| 71 | 71 | conn.destroy(err); | |
| 72 | 72 | }); | |
| 73 | 73 | ||
| 74 | - this.timeout = 2 * 60 * 1000; | ||
| 74 | + this.timeout = 0; | ||
| 75 | 75 | this.keepAliveTimeout = 5000; | |
| 76 | 76 | this.maxHeadersCount = null; | |
| 77 | 77 | this.headersTimeout = 40 * 1000; // 40 seconds | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,8 +171,6 @@ const kState = Symbol('state'); | |||
| 171 | 171 | const kType = Symbol('type'); | |
| 172 | 172 | const kWriteGeneric = Symbol('write-generic'); | |
| 173 | 173 | ||
| 174 | - const kDefaultSocketTimeout = 2 * 60 * 1000; | ||
| 175 | - | ||
| 176 | 174 | const { | |
| 177 | 175 | paddingBuffer, | |
| 178 | 176 | PADDING_BUF_FRAME_LENGTH, | |
@@ -2680,7 +2678,7 @@ class Http2SecureServer extends TLSServer { | |||
| 2680 | 2678 | options = initializeTLSOptions(options); | |
| 2681 | 2679 | super(options, connectionListener); | |
| 2682 | 2680 | this[kOptions] = options; | |
| 2683 | - this.timeout = kDefaultSocketTimeout; | ||
| 2681 | + this.timeout = 0; | ||
| 2684 | 2682 | this.on('newListener', setupCompat); | |
| 2685 | 2683 | if (typeof requestListener === 'function') | |
| 2686 | 2684 | this.on('request', requestListener); | |
@@ -2702,7 +2700,7 @@ class Http2Server extends NETServer { | |||
| 2702 | 2700 | constructor(options, requestListener) { | |
| 2703 | 2701 | super(connectionListener); | |
| 2704 | 2702 | this[kOptions] = initializeOptions(options); | |
| 2705 | - this.timeout = kDefaultSocketTimeout; | ||
| 2703 | + this.timeout = 0; | ||
| 2706 | 2704 | this.on('newListener', setupCompat); | |
| 2707 | 2705 | if (typeof requestListener === 'function') | |
| 2708 | 2706 | this.on('request', requestListener); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,9 +43,6 @@ process.on('exit', function() { | |||
| 43 | 43 | { type: 'HTTPINCOMINGMESSAGE', | |
| 44 | 44 | id: 'httpincomingmessage:1', | |
| 45 | 45 | triggerAsyncId: 'tcp:2' }, | |
| 46 | - { type: 'Timeout', | ||
| 47 | - id: 'timeout:2', | ||
| 48 | - triggerAsyncId: 'tcp:2' }, | ||
| 49 | 46 | { type: 'SHUTDOWNWRAP', | |
| 50 | 47 | id: 'shutdown:1', | |
| 51 | 48 | triggerAsyncId: 'tcp:2' } ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,7 @@ server.listen(0, common.mustCall(() => { | |||
| 46 | 46 | }, common.mustCall((res) => { | |
| 47 | 47 | res.on('data', () => {}); | |
| 48 | 48 | res.on('end', common.mustCall(() => { | |
| 49 | - assert.strictEqual(socket[kTimeout]._idleTimeout, -1); | ||
| 49 | + assert.strictEqual(socket[kTimeout], null); | ||
| 50 | 50 | assert.strictEqual(socket.parser, null); | |
| 51 | 51 | assert.strictEqual(socket._httpMessage, null); | |
| 52 | 52 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments