]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.16] net/http: update bundled golang.org/x/net/http2
authorCarlos Amedee <carlos@golang.org>
Thu, 6 Jan 2022 02:08:15 +0000 (21:08 -0500)
committerCarlos Amedee <carlos@golang.org>
Thu, 6 Jan 2022 15:30:21 +0000 (15:30 +0000)
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>

src/go.mod
src/go.sum
src/net/http/h2_bundle.go
src/vendor/modules.txt

index 977370d2653873a561150e559bfab3bd7146e204..940ad6dda62d5603beedcaac2ebd5d90da39d3fe 100644 (file)
@@ -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
 )
index 1032a505181ba734d8d765ef00f5688ec649daac..fc62a8954a8473308932c22355e27dd15d5628d1 100644 (file)
@@ -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=
index 6a0c1acf5f6cfc47ed11da7a8e3876ee33c68c11..00a4bcc8cb231c23b260bbb82d2d213d66c8161b 100644 (file)
@@ -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
        }
index a37d539508c74592ed298db7a8f1a4be630aebb6..9a72c2320ef527a7505c089d21ffcaab586aa556 100644 (file)
@@ -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