Commit 8c4bec8f authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: update bundled http2

Update x/net/http2 to git rev 6b17b9baf5 for:

   http2: stop rejecting outgoing paths beginning with two slashes
   https://golang.org/cl/45773

This also uses an updated version of x/tools/cmd/bundle (CL 45190)
that fixes an edge case where it used to drop some comments.

Updates #20627
Fixes #19103

Change-Id: I450d61485e66098f4f8a79954f729f7bcd85856f
Reviewed-on: https://go-review.googlesource.com/45700
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarChris Broadfoot <cbro@golang.org>
parent cf7347a9
...@@ -48,6 +48,9 @@ import ( ...@@ -48,6 +48,9 @@ import (
"golang_org/x/net/lex/httplex" "golang_org/x/net/lex/httplex"
) )
// A list of the possible cipher suite ids. Taken from
// http://www.iana.org/assignments/tls-parameters/tls-parameters.txt
const ( const (
http2cipher_TLS_NULL_WITH_NULL_NULL uint16 = 0x0000 http2cipher_TLS_NULL_WITH_NULL_NULL uint16 = 0x0000
http2cipher_TLS_RSA_WITH_NULL_MD5 uint16 = 0x0001 http2cipher_TLS_RSA_WITH_NULL_MD5 uint16 = 0x0001
...@@ -1206,11 +1209,16 @@ type http2goAwayFlowError struct{} ...@@ -1206,11 +1209,16 @@ type http2goAwayFlowError struct{}
func (http2goAwayFlowError) Error() string { return "connection exceeded flow control window size" } func (http2goAwayFlowError) Error() string { return "connection exceeded flow control window size" }
// connError represents an HTTP/2 ConnectionError error code, along
// with a string (for debugging) explaining why.
//
// Errors of this type are only returned by the frame parser functions // Errors of this type are only returned by the frame parser functions
// and converted into ConnectionError(ErrCodeProtocol). // and converted into ConnectionError(Code), after stashing away
// the Reason into the Framer's errDetail field, accessible via
// the (*Framer).ErrorDetail method.
type http2connError struct { type http2connError struct {
Code http2ErrCode Code http2ErrCode // the ConnectionError error code
Reason string Reason string // additional reason
} }
func (e http2connError) Error() string { func (e http2connError) Error() string {
...@@ -3562,14 +3570,18 @@ func (s *http2sorter) SortStrings(ss []string) { ...@@ -3562,14 +3570,18 @@ func (s *http2sorter) SortStrings(ss []string) {
// validPseudoPath reports whether v is a valid :path pseudo-header // validPseudoPath reports whether v is a valid :path pseudo-header
// value. It must be either: // value. It must be either:
// //
// *) a non-empty string starting with '/', but not with with "//", // *) a non-empty string starting with '/'
// *) the string '*', for OPTIONS requests. // *) the string '*', for OPTIONS requests.
// //
// For now this is only used a quick check for deciding when to clean // For now this is only used a quick check for deciding when to clean
// up Opaque URLs before sending requests from the Transport. // up Opaque URLs before sending requests from the Transport.
// See golang.org/issue/16847 // See golang.org/issue/16847
//
// We used to enforce that the path also didn't start with "//", but
// Google's GFE accepts such paths and Chrome sends them, so ignore
// that part of the spec. See golang.org/issue/19103.
func http2validPseudoPath(v string) bool { func http2validPseudoPath(v string) bool {
return (len(v) > 0 && v[0] == '/' && (len(v) == 1 || v[1] != '/')) || v == "*" return (len(v) > 0 && v[0] == '/') || v == "*"
} }
// pipe is a goroutine-safe io.Reader/io.Writer pair. It's like // pipe is a goroutine-safe io.Reader/io.Writer pair. It's like
...@@ -8694,7 +8706,7 @@ func (p *http2writeGoAway) writeFrame(ctx http2writeContext) error { ...@@ -8694,7 +8706,7 @@ func (p *http2writeGoAway) writeFrame(ctx http2writeContext) error {
return err return err
} }
func (*http2writeGoAway) staysWithinBuffer(max int) bool { return false } func (*http2writeGoAway) staysWithinBuffer(max int) bool { return false } // flushes
type http2writeData struct { type http2writeData struct {
streamID uint32 streamID uint32
...@@ -9205,7 +9217,7 @@ func (p *http2writeQueuePool) get() *http2writeQueue { ...@@ -9205,7 +9217,7 @@ func (p *http2writeQueuePool) get() *http2writeQueue {
} }
// RFC 7540, Section 5.3.5: the default weight is 16. // RFC 7540, Section 5.3.5: the default weight is 16.
const http2priorityDefaultWeight = 15 const http2priorityDefaultWeight = 15 // 16 = 15 + 1
// PriorityWriteSchedulerConfig configures a priorityWriteScheduler. // PriorityWriteSchedulerConfig configures a priorityWriteScheduler.
type http2PriorityWriteSchedulerConfig struct { type http2PriorityWriteSchedulerConfig struct {
......
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