summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2019-05-03 16:45:57 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2019-05-09 08:54:04 -0700
commitc30ef3cbd2e42ac1d600f6bd78a601a5496b0877 (patch)
tree44087e0e6bc08c1bc846f72daf9bd418a7c24ea8 /lib
parente582d1191376b8bf129a04730b04a2cd52ae5202 (diff)
downloadandroid-node-v8-c30ef3cbd2e42ac1d600f6bd78a601a5496b0877.tar.gz
android-node-v8-c30ef3cbd2e42ac1d600f6bd78a601a5496b0877.tar.bz2
android-node-v8-c30ef3cbd2e42ac1d600f6bd78a601a5496b0877.zip
http, http2: remove default server timeout
Timing out and closing the socket after two minutes have elapsed is surprising and problematic for users. This behavior was specific to Node.js, and doesn't seem to be common in other language runtimes. Fixes: https://github.com/nodejs/node/issues/27556 PR-URL: https://github.com/nodejs/node/pull/27558 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_server.js2
-rw-r--r--lib/https.js2
-rw-r--r--lib/internal/http2/core.js6
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/_http_server.js b/lib/_http_server.js
index 9f62872e8e..f7884d2626 100644
--- a/lib/_http_server.js
+++ b/lib/_http_server.js
@@ -315,7 +315,7 @@ function Server(options, requestListener) {
this.on('connection', connectionListener);
- this.timeout = 2 * 60 * 1000;
+ this.timeout = 0;
this.keepAliveTimeout = 5000;
this.maxHeadersCount = null;
this.headersTimeout = 40 * 1000; // 40 seconds
diff --git a/lib/https.js b/lib/https.js
index 4e64901731..e1fc91fd96 100644
--- a/lib/https.js
+++ b/lib/https.js
@@ -71,7 +71,7 @@ function Server(opts, requestListener) {
conn.destroy(err);
});
- this.timeout = 2 * 60 * 1000;
+ this.timeout = 0;
this.keepAliveTimeout = 5000;
this.maxHeadersCount = null;
this.headersTimeout = 40 * 1000; // 40 seconds
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index 58193b41cd..6ad1668c4f 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -171,8 +171,6 @@ const kState = Symbol('state');
const kType = Symbol('type');
const kWriteGeneric = Symbol('write-generic');
-const kDefaultSocketTimeout = 2 * 60 * 1000;
-
const {
paddingBuffer,
PADDING_BUF_FRAME_LENGTH,
@@ -2680,7 +2678,7 @@ class Http2SecureServer extends TLSServer {
options = initializeTLSOptions(options);
super(options, connectionListener);
this[kOptions] = options;
- this.timeout = kDefaultSocketTimeout;
+ this.timeout = 0;
this.on('newListener', setupCompat);
if (typeof requestListener === 'function')
this.on('request', requestListener);
@@ -2702,7 +2700,7 @@ class Http2Server extends NETServer {
constructor(options, requestListener) {
super(connectionListener);
this[kOptions] = initializeOptions(options);
- this.timeout = kDefaultSocketTimeout;
+ this.timeout = 0;
this.on('newListener', setupCompat);
if (typeof requestListener === 'function')
this.on('request', requestListener);