]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.17] net/http: update bundled golang.org/x/net/http2
authorCarlos Amedee <carlos@golang.org>
Thu, 6 Jan 2022 01:58:23 +0000 (20:58 -0500)
committerCarlos Amedee <carlos@golang.org>
Thu, 6 Jan 2022 15:30:17 +0000 (15:30 +0000)
Pull in approved backports to golang.org/x/net/http2:

    21a9c9c http2: prioritize RST_STREAM frames in random write scheduler

By doing:

    $ go get -d golang.org/x/net@internal-branch.go1.17-vendor
    $ go mod tidy
    $ go mod vendor
    $ go generate -run=bundle std

Fixes #49921

Change-Id: I04739a30d84a8ae449374eca8bb11c7d2d215ad9
Reviewed-on: https://go-review.googlesource.com/c/go/+/375814
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@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 882175c2220388ccd44f557dd6420e8804f5823e..af435fa335126c997994d86a3be0348b77227c21 100644 (file)
@@ -4,7 +4,7 @@ go 1.17
 
 require (
        golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e
-       golang.org/x/net v0.0.0-20211209100829-84cba5454caf
+       golang.org/x/net v0.0.0-20220106012031-21a9c9cfe9c3
 )
 
 require (
index db8c6da399f1603333e6e737306f27f35ce24642..3e3fa7989fa45beb68d9125d2947d7cb4d881055 100644 (file)
@@ -1,8 +1,8 @@
 golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU=
 golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20211209100829-84cba5454caf h1:Chci/BE/+xVqrcWnObL99NS8gtXyJrhHDlygBQrggHM=
-golang.org/x/net v0.0.0-20211209100829-84cba5454caf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220106012031-21a9c9cfe9c3 h1:3S9JjS9zI0UiDupLpAuaeuciTu/gEk5jf35rQgqOhXQ=
+golang.org/x/net v0.0.0-20220106012031-21a9c9cfe9c3/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q=
index 2463118eb9a5cbdb52d88483dc2da50ad91d4b4d..b049a79ccfdfc7ac669139fdc7c45289ce5db125 100644 (file)
@@ -9901,7 +9901,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)
 }
 
@@ -9921,6 +9922,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
@@ -10600,11 +10602,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()
@@ -10614,7 +10616,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 55e546acd64e31a8604e512a5fc6bd602bc1003c..a1b16d7b84fe85be30d06e0908ff281b7d28917e 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-20211209100829-84cba5454caf
+# golang.org/x/net v0.0.0-20220106012031-21a9c9cfe9c3
 ## explicit; go 1.17
 golang.org/x/net/dns/dnsmessage
 golang.org/x/net/http/httpguts