]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: add doc details regarding Transport retries
authorSimon Kotwicz <simonkotwicz@gmail.com>
Sun, 20 Feb 2022 08:24:08 +0000 (08:24 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 20:25:33 +0000 (20:25 +0000)
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>

src/net/http/transport.go

index 8de63cdb8857d4eef7fa6338e321d2b317566549..3ed5068eefd272f4004bf3261970d9b3944dbb00 100644 (file)
@@ -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