]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: update bundled http2 for write scheduling order fix
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 15 Nov 2016 01:36:34 +0000 (01:36 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 15 Nov 2016 01:52:44 +0000 (01:52 +0000)
Updates x/net/http2 to x/net git rev 00ed5e9 for:

    http2: schedule RSTStream writes onto its stream's queue
    https://golang.org/cl/33238

Fixes #17243

Change-Id: I79cc5d15bf69ead28d549d4f798c12f4ee2a2201
Reviewed-on: https://go-review.googlesource.com/33241
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/h2_bundle.go

index 085a6fab54163c1fb89fe4e8bbecf141787785c9..bb7f05df2e157a828de716d4ec7d9b2a8ee4c46f 100644 (file)
@@ -7681,6 +7681,10 @@ type http2FrameWriteRequest struct {
 // 0 is used for non-stream frames such as PING and SETTINGS.
 func (wr http2FrameWriteRequest) StreamID() uint32 {
        if wr.stream == nil {
+               if se, ok := wr.write.(http2StreamError); ok {
+
+                       return se.StreamID
+               }
                return 0
        }
        return wr.stream.id
@@ -7754,17 +7758,13 @@ func (wr http2FrameWriteRequest) Consume(n int32) (http2FrameWriteRequest, http2
 
 // String is for debugging only.
 func (wr http2FrameWriteRequest) String() string {
-       var streamID uint32
-       if wr.stream != nil {
-               streamID = wr.stream.id
-       }
        var des string
        if s, ok := wr.write.(fmt.Stringer); ok {
                des = s.String()
        } else {
                des = fmt.Sprintf("%T", wr.write)
        }
-       return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", streamID, wr.done != nil, des)
+       return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", wr.StreamID(), wr.done != nil, des)
 }
 
 // writeQueue is used by implementations of WriteScheduler.