aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorSimon Kotwicz <simonkotwicz@gmail.com>2022-02-20 08:24:08 +0000
committerGopher Robot <gobot@golang.org>2023-05-24 20:25:33 +0000
commit3c6883ccbc6a59569222e8295784200b4e662d3e (patch)
tree341efe1820338aae7633e1651e1ea9fb8d861951 /src/net/http
parent9a49b26bdf771ecdfa2d3bc3ee5175eed5321f20 (diff)
downloadgo-3c6883ccbc6a59569222e8295784200b4e662d3e.tar.xz
net/http: add doc details regarding Transport retries
Add doc details to Transport mentioning retries only occur if a connection has been already been used successfully. Change-Id: I37afbad50b885248e0e6cd5e799ad848bf97c86b GitHub-Last-Rev: 7c45c32aec2bd3266c525bf28ab1879acbecf193 GitHub-Pull-Request: golang/go#51273 Reviewed-on: https://go-review.googlesource.com/c/go/+/386994 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/transport.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 8de63cdb88..3ed5068eef 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -85,13 +85,13 @@ const DefaultMaxIdleConnsPerHost = 2
// ClientTrace.Got1xxResponse.
//
// Transport only retries a request upon encountering a network error
-// if the request is idempotent and either has no body or has its
-// Request.GetBody defined. HTTP requests are considered idempotent if
-// they have HTTP methods GET, HEAD, OPTIONS, or TRACE; or if their
-// Header map contains an "Idempotency-Key" or "X-Idempotency-Key"
-// entry. If the idempotency key value is a zero-length slice, the
-// request is treated as idempotent but the header is not sent on the
-// wire.
+// if the connection has been already been used successfully and if the
+// request is idempotent and either has no body or has its Request.GetBody
+// defined. HTTP requests are considered idempotent if they have HTTP methods
+// GET, HEAD, OPTIONS, or TRACE; or if their Header map contains an
+// "Idempotency-Key" or "X-Idempotency-Key" entry. If the idempotency key
+// value is a zero-length slice, the request is treated as idempotent but the
+// header is not sent on the wire.
type Transport struct {
idleMu sync.Mutex
closeIdle bool // user has requested to close all idle conns