diff options
| author | Damien Neil <dneil@google.com> | 2024-09-25 11:10:07 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-09-26 16:14:14 -0700 |
| commit | 3a5df9d2b20c0f059c463b5d51e89be17a2c685b (patch) | |
| tree | 8163d083beaf4b1f5683fb3ea56ed97bff67f39a /src/net/http/http.go | |
| parent | 16be34df02ba073456e5f31203549165585f3e6c (diff) | |
| download | go-3a5df9d2b20c0f059c463b5d51e89be17a2c685b.tar.xz | |
net/http: add HTTP2Config.StrictMaxConcurrentRequests
Add a field to HTTP2Config controlling how we behave when an HTTP/2
connection reaches its concurrency limit.
This field will have no effect until golang.org/x/net/http2 is
updated to make use of it, and h2_bundle.go is updated with the
new http2 package.
For #67813
Change-Id: Ic72a0986528abb21649f28e9fe7cf6e1236b388d
Reviewed-on: https://go-review.googlesource.com/c/go/+/615875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Diffstat (limited to 'src/net/http/http.go')
| -rw-r--r-- | src/net/http/http.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/net/http/http.go b/src/net/http/http.go index 0f9165bf03..e7959fa3b6 100644 --- a/src/net/http/http.go +++ b/src/net/http/http.go @@ -235,10 +235,23 @@ type Pusher interface { // both [Transport] and [Server]. type HTTP2Config struct { // MaxConcurrentStreams optionally specifies the number of - // concurrent streams that a peer may have open at a time. + // concurrent streams that a client may have open at a time. // If zero, MaxConcurrentStreams defaults to at least 100. + // + // This parameter only applies to Servers. MaxConcurrentStreams int + // StrictMaxConcurrentRequests controls whether an HTTP/2 server's + // concurrency limit should be respected across all connections + // to that server. + // If true, new requests sent when a connection's concurrency limit + // has been exceeded will block until an existing request completes. + // If false, an additional connection will be opened if all + // existing connections are at their limit. + // + // This parameter only applies to Transports. + StrictMaxConcurrentRequests bool + // MaxDecoderHeaderTableSize optionally specifies an upper limit for the // size of the header compression table used for decoding headers sent // by the peer. |
