http: destroy sockets after keepAliveTimeout

Implement server.keepAliveTimeout in addition to server.timeout to
prevent temporary socket/memory leaking in keep-alive mode.

PR-URL: https://github.com/nodejs/node/pull/2534
Author: Timur Shemsedinov <timur.shemsedinov@gmail.com>
Author: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
Timur Shemsedinov authored and Rod Vagg committed 2019-02-28 16:55:53 +11:00
1 parent d82f8c4c35
commit f23b3b6bad
6 files changed
+249 -7

No files matched your search

+9
View File
@@ -46,6 +46,14 @@ added: v0.11.2
See [`http.Server#timeout`][].
### server.keepAliveTimeout
<!-- YAML
added: REPLACEME
-->
- {number} Defaults to 5000 (5 seconds).
See [`http.Server#keepAliveTimeout`][].
## https.createServer(options[, requestListener])
<!-- YAML
added: v0.3.4
@@ -240,6 +248,7 @@ const req = https.request(options, (res) => {
[`globalAgent`]: #https_https_globalagent
[`http.Agent`]: http.html#http_class_http_agent
[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
[`http.Server#keepAliveTimeout`]: http.html#http_server_keepalivetimeout
[`http.close()`]: http.html#http_server_close_callback
[`http.get()`]: http.html#http_http_get_options_callback
[`http.listen()`]: http.html#http_server_listen_port_hostname_backlog_callback