Commit 2cb3d1d8 authored by Tom Bergan's avatar Tom Bergan Committed by Brad Fitzpatrick

net/http: update bundled x/net/http2

This updates the bundled copy of x/net/http2 to x/net git rev
3470a06c1357df53 for:

http2: fix typo in comment
https://golang.org/cl/44271

http2: fix nil dereference after Read completes with an error
https://golang.org/cl/44330

Fixes #20501

Change-Id: Ie6a5fb092f77044f504f146721dae86299e04011
Reviewed-on: https://go-review.googlesource.com/44331
Run-TryBot: Tom Bergan <tombergan@google.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 0a3f3e16
...@@ -959,7 +959,7 @@ func http2configureTransport(t1 *Transport) (*http2Transport, error) { ...@@ -959,7 +959,7 @@ func http2configureTransport(t1 *Transport) (*http2Transport, error) {
} }
// registerHTTPSProtocol calls Transport.RegisterProtocol but // registerHTTPSProtocol calls Transport.RegisterProtocol but
// convering panics into errors. // converting panics into errors.
func http2registerHTTPSProtocol(t *Transport, rt RoundTripper) (err error) { func http2registerHTTPSProtocol(t *Transport, rt RoundTripper) (err error) {
defer func() { defer func() {
if e := recover(); e != nil { if e := recover(); e != nil {
...@@ -3555,7 +3555,7 @@ func (p *http2pipe) Read(d []byte) (n int, err error) { ...@@ -3555,7 +3555,7 @@ func (p *http2pipe) Read(d []byte) (n int, err error) {
if p.breakErr != nil { if p.breakErr != nil {
return 0, p.breakErr return 0, p.breakErr
} }
if p.b.Len() > 0 { if p.b != nil && p.b.Len() > 0 {
return p.b.Read(d) return p.b.Read(d)
} }
if p.err != nil { if p.err != nil {
...@@ -8811,7 +8811,7 @@ type http2PriorityWriteSchedulerConfig struct { ...@@ -8811,7 +8811,7 @@ type http2PriorityWriteSchedulerConfig struct {
} }
// NewPriorityWriteScheduler constructs a WriteScheduler that schedules // NewPriorityWriteScheduler constructs a WriteScheduler that schedules
// frames by following HTTP/2 priorities as described in RFC 7340 Section 5.3. // frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3.
// If cfg is nil, default options are used. // If cfg is nil, default options are used.
func http2NewPriorityWriteScheduler(cfg *http2PriorityWriteSchedulerConfig) http2WriteScheduler { func http2NewPriorityWriteScheduler(cfg *http2PriorityWriteSchedulerConfig) http2WriteScheduler {
if cfg == nil { if cfg == nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment