aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/http2/writesched_priority.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/http2/writesched_priority.go')
-rw-r--r--vendor/golang.org/x/net/http2/writesched_priority.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go
index 40108b0..0113272 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority.go
@@ -388,7 +388,15 @@ func (ws *priorityWriteScheduler) Push(wr FrameWriteRequest) {
} else {
n = ws.nodes[id]
if n == nil {
- panic("add on non-open stream")
+ // id is an idle or closed stream. wr should not be a HEADERS or
+ // DATA frame. However, wr can be a RST_STREAM. In this case, we
+ // push wr onto the root, rather than creating a new priorityNode,
+ // since RST_STREAM is tiny and the stream's priority is unknown
+ // anyway. See issue #17919.
+ if wr.DataSize() > 0 {
+ panic("add DATA on non-open stream")
+ }
+ n = &ws.root
}
}
n.q.push(wr)