aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-03-08 23:08:13 -0500
committerDamien Neil <dneil@google.com>2024-03-10 07:39:08 +0000
commit48b10c9af7955bcab179b60a148a633a0a75cde7 (patch)
tree6bf89c423ec52c17523e55b81bbac66a4d061b60 /src/net/http
parent1e433915ce684049a6a44fd506f691f448b56c76 (diff)
downloadgo-48b10c9af7955bcab179b60a148a633a0a75cde7.tar.xz
net/http: update bundle
go install golang.org/x/tools/cmd/bundle@latest go generate net/http This fixes the longtest builders, which broke at CL 570156. Change-Id: I85e6a1c20bd0080228400a561efd750342ae2d67 Reviewed-on: https://go-review.googlesource.com/c/go/+/570276 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Russ Cox <rsc@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/h2_bundle.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 2fc8ace61e..029c584a5e 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -7172,6 +7172,12 @@ type http2Transport struct {
// waiting for their turn.
StrictMaxConcurrentStreams bool
+ // IdleConnTimeout is the maximum amount of time an idle
+ // (keep-alive) connection will remain idle before closing
+ // itself.
+ // Zero means no limit.
+ IdleConnTimeout time.Duration
+
// ReadIdleTimeout is the timeout after which a health check using ping
// frame will be carried out if no frame is received on the connection.
// Note that a ping response will is considered a received frame, so if
@@ -9938,6 +9944,15 @@ func (rl *http2clientConnReadLoop) processWindowUpdate(f *http2WindowUpdateFrame
fl = &cs.flow
}
if !fl.add(int32(f.Increment)) {
+ // For stream, the sender sends RST_STREAM with an error code of FLOW_CONTROL_ERROR
+ if cs != nil {
+ rl.endStreamError(cs, http2StreamError{
+ StreamID: f.StreamID,
+ Code: http2ErrCodeFlowControl,
+ })
+ return nil
+ }
+
return http2ConnectionError(http2ErrCodeFlowControl)
}
cc.cond.Broadcast()
@@ -10171,9 +10186,17 @@ func (rt http2noDialH2RoundTripper) RoundTrip(req *Request) (*Response, error) {
}
func (t *http2Transport) idleConnTimeout() time.Duration {
+ // to keep things backwards compatible, we use non-zero values of
+ // IdleConnTimeout, followed by using the IdleConnTimeout on the underlying
+ // http1 transport, followed by 0
+ if t.IdleConnTimeout != 0 {
+ return t.IdleConnTimeout
+ }
+
if t.t1 != nil {
return t.t1.IdleConnTimeout
}
+
return 0
}