From e4921d4ff39cc4c38d03e1129ec63e3c41f62e11 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Tue, 14 May 2019 14:50:37 -0700 Subject: [PATCH] http, http2: flag for overriding server timeout Make it possible to override the default http server timeout. Ideally there should be no server timeout - as done on the master branch. This is a non-breaking way to enable platform providers to override the value. PR-URL: https://github.com/nodejs/node/pull/27704 Refs: https://github.com/nodejs/node/pull/27558 Refs: https://github.com/nodejs/node/issues/27556 Reviewed-By: Anna Henningsen Reviewed-By: Myles Borins Reviewed-By: Ruben Bridgewater --- doc/api/cli.md | 12 ++++++++ doc/api/http.md | 7 +++++ doc/api/http2.md | 7 +++++ doc/node.1 | 3 ++ lib/_http_server.js | 5 ++- lib/https.js | 6 +++- lib/internal/http2/core.js | 8 +++-- src/node_options.cc | 5 +++ src/node_options.h | 1 + test/parallel/test-http-timeout-flag.js | 41 +++++++++++++++++++++++++ 10 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 test/parallel/test-http-timeout-flag.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 7563515b9f9b21..c90fe4bd5f5015 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -119,6 +119,17 @@ added: v6.0.0 Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) (Same requirements as `--enable-fips`.) +### `--http-server-default-timeout=milliseconds` + + +Overrides the default value of `http`, `https` and `http2` server socket +timeout. Setting the value to 0 disables server socket timeout. Unless +provided, http server sockets timeout after 120s (2 minutes). Programmatic +setting of the timeout takes precedence over the value set through this +flag. + ### `--icu-data-dir=file`