diff options
author | killagu <killa123@126.com> | 2018-06-08 12:42:27 +0800 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-07-13 18:44:03 +0200 |
commit | 949e8851484c016c07f6cc9e5889f0f2e56baf2a (patch) | |
tree | aaf19ca5fde1600bd8000228f368ec96afc7c43b /doc/api/http.md | |
parent | d462f8cfe34019ab8bf1d57d33bf16e64c8fb815 (diff) | |
download | android-node-v8-949e8851484c016c07f6cc9e5889f0f2e56baf2a.tar.gz android-node-v8-949e8851484c016c07f6cc9e5889f0f2e56baf2a.tar.bz2 android-node-v8-949e8851484c016c07f6cc9e5889f0f2e56baf2a.zip |
http: fix request with option timeout and agent
When request with both timeout and agent, timeout not
work. This patch will fix it, socket timeout will set
to request timeout before socket is connected, and
socket timeout will reset to agent timeout after
response end.
Fixes: https://github.com/nodejs/node/issues/21185
PR-URL: https://github.com/nodejs/node/pull/21204
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r-- | doc/api/http.md | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 78f8bc4b6b..fdbc99774e 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -126,6 +126,8 @@ added: v0.3.4 * `maxFreeSockets` {number} Maximum number of sockets to leave open in a free state. Only relevant if `keepAlive` is set to `true`. **Default:** `256`. + * `timeout` {number} Socket timeout in milliseconds. + This will set the timeout after the socket is connected. The default [`http.globalAgent`][] that is used by [`http.request()`][] has all of these values set to their respective defaults. |