aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Amedee <carlos@golang.org>2022-01-05 21:08:15 -0500
committerCarlos Amedee <carlos@golang.org>2022-01-06 15:30:21 +0000
commit0551247ca30c574aec0252c27476e218002f6bbc (patch)
tree6a2511bd6356874db1ba4df3bf2fadc29a0d22ba
parenta845a562a0f2abd96c448a1ab3effe65d154353a (diff)
downloadgo-0551247ca30c574aec0252c27476e218002f6bbc.tar.gz
go-0551247ca30c574aec0252c27476e218002f6bbc.zip
[release-branch.go1.16] net/http: update bundled golang.org/x/net/http2
Pull in approved backports to golang.org/x/net/http2: aa5a62b http2: prioritize RST_STREAM frames in random write scheduler By doing: $ go get -d golang.org/x/net@internal-branch.go1.16-vendor $ go mod tidy $ go mod vendor $ go generate -run=bundle std Fixes #50449 Change-Id: I4a6a8ae943d2d1705209e648a63421914062d3e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/375815 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Carlos Amedee <carlos@golang.org>
-rw-r--r--src/go.mod2
-rw-r--r--src/go.sum4
-rw-r--r--src/net/http/h2_bundle.go10
-rw-r--r--src/vendor/modules.txt2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/go.mod b/src/go.mod
index 977370d265..940ad6dda6 100644
--- a/src/go.mod
+++ b/src/go.mod
@@ -4,7 +4,7 @@ go 1.16
require (
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
- golang.org/x/net v0.0.0-20211209100217-a5309b321dca
+ golang.org/x/net v0.0.0-20220106012026-aa5a62bac9b2
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
golang.org/x/text v0.3.4 // indirect
)
diff --git a/src/go.sum b/src/go.sum
index 1032a50518..fc62a8954a 100644
--- a/src/go.sum
+++ b/src/go.sum
@@ -2,8 +2,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20211209100217-a5309b321dca h1:UmeWAm8AwB6NA/e4FSaGlK1EKTLXKX3utx4Si+6kfPg=
-golang.org/x/net v0.0.0-20211209100217-a5309b321dca/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20220106012026-aa5a62bac9b2 h1:stMOlKq3irM+8bKr23owjlOdTCooe6glD9WAQcwXgxw=
+golang.org/x/net v0.0.0-20220106012026-aa5a62bac9b2/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 6a0c1acf5f..00a4bcc8cb 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -9896,7 +9896,8 @@ type http2WriteScheduler interface {
// Pop dequeues the next frame to write. Returns false if no frames can
// be written. Frames with a given wr.StreamID() are Pop'd in the same
- // order they are Push'd. No frames should be discarded except by CloseStream.
+ // order they are Push'd, except RST_STREAM frames. No frames should be
+ // discarded except by CloseStream.
Pop() (wr http2FrameWriteRequest, ok bool)
}
@@ -9916,6 +9917,7 @@ type http2FrameWriteRequest struct {
// stream is the stream on which this frame will be written.
// nil for non-stream frames like PING and SETTINGS.
+ // nil for RST_STREAM streams, which use the StreamError.StreamID field instead.
stream *http2stream
// done, if non-nil, must be a buffered channel with space for
@@ -10595,11 +10597,11 @@ func (ws *http2randomWriteScheduler) AdjustStream(streamID uint32, priority http
}
func (ws *http2randomWriteScheduler) Push(wr http2FrameWriteRequest) {
- id := wr.StreamID()
- if id == 0 {
+ if wr.isControl() {
ws.zero.push(wr)
return
}
+ id := wr.StreamID()
q, ok := ws.sq[id]
if !ok {
q = ws.queuePool.get()
@@ -10609,7 +10611,7 @@ func (ws *http2randomWriteScheduler) Push(wr http2FrameWriteRequest) {
}
func (ws *http2randomWriteScheduler) Pop() (http2FrameWriteRequest, bool) {
- // Control frames first.
+ // Control and RST_STREAM frames first.
if !ws.zero.empty() {
return ws.zero.shift(), true
}
diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
index a37d539508..9a72c2320e 100644
--- a/src/vendor/modules.txt
+++ b/src/vendor/modules.txt
@@ -8,7 +8,7 @@ golang.org/x/crypto/curve25519
golang.org/x/crypto/hkdf
golang.org/x/crypto/internal/subtle
golang.org/x/crypto/poly1305
-# golang.org/x/net v0.0.0-20211209100217-a5309b321dca
+# golang.org/x/net v0.0.0-20220106012026-aa5a62bac9b2
## explicit
golang.org/x/net/dns/dnsmessage
golang.org/x/net/http/httpguts