chore(deps): bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 (#2578)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.9.0. - [Commits](https://github.com/golang/oauth2/compare/v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									ef551f4219
								
							
						
					
					
						commit
						22df0b3046
					
				
							
								
								
									
										8
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										8
									
								
								go.mod
								
								
								
								
							|  | @ -34,8 +34,8 @@ require ( | ||||||
| 	github.com/spf13/afero v1.9.5 | 	github.com/spf13/afero v1.9.5 | ||||||
| 	github.com/spf13/cobra v1.7.0 | 	github.com/spf13/cobra v1.7.0 | ||||||
| 	github.com/spf13/pflag v1.0.5 | 	github.com/spf13/pflag v1.0.5 | ||||||
| 	golang.org/x/net v0.10.0 | 	golang.org/x/net v0.11.0 | ||||||
| 	golang.org/x/oauth2 v0.8.0 | 	golang.org/x/oauth2 v0.9.0 | ||||||
| 	golang.org/x/sync v0.2.0 | 	golang.org/x/sync v0.2.0 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -146,9 +146,9 @@ require ( | ||||||
| 	go.etcd.io/etcd/raft/v3 v3.5.6 // indirect | 	go.etcd.io/etcd/raft/v3 v3.5.6 // indirect | ||||||
| 	go.opencensus.io v0.24.0 // indirect | 	go.opencensus.io v0.24.0 // indirect | ||||||
| 	go.uber.org/goleak v1.2.1 // indirect | 	go.uber.org/goleak v1.2.1 // indirect | ||||||
| 	golang.org/x/crypto v0.9.0 // indirect | 	golang.org/x/crypto v0.10.0 // indirect | ||||||
| 	golang.org/x/sys v0.9.0 | 	golang.org/x/sys v0.9.0 | ||||||
| 	golang.org/x/text v0.9.0 // indirect | 	golang.org/x/text v0.10.0 // indirect | ||||||
| 	golang.org/x/time v0.1.0 // indirect | 	golang.org/x/time v0.1.0 // indirect | ||||||
| 	golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect | 	golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect | ||||||
| 	google.golang.org/api v0.127.0 | 	google.golang.org/api v0.127.0 | ||||||
|  |  | ||||||
							
								
								
									
										18
									
								
								go.sum
								
								
								
								
							
							
						
						
									
										18
									
								
								go.sum
								
								
								
								
							|  | @ -699,8 +699,8 @@ golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0 | ||||||
| golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | ||||||
| golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | ||||||
| golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= | golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= | ||||||
| golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= | golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= | ||||||
| golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= | golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= | ||||||
| golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | ||||||
| golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | ||||||
| golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | ||||||
|  | @ -788,8 +788,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su | ||||||
| golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= | ||||||
| golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= | golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= | ||||||
| golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= | golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= | ||||||
| golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= | golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= | ||||||
| golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= | golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= | ||||||
| golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | ||||||
| golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||||
| golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||||
|  | @ -804,8 +804,8 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ | ||||||
| golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||||
| golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= | ||||||
| golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= | golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= | ||||||
| golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= | golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= | ||||||
| golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= | golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= | ||||||
| golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||||
| golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||||
| golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||||
|  | @ -905,7 +905,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn | ||||||
| golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||||
| golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= | golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= | ||||||
| golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= | golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= | ||||||
| golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= | golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= | ||||||
| golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||||
| golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||||
|  | @ -918,8 +918,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= | ||||||
| golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= | golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= | ||||||
| golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= | golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= | ||||||
| golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= | golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= | ||||||
| golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= | golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= | ||||||
| golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= | golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= | ||||||
| golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | ||||||
| golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | ||||||
| golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | ||||||
|  |  | ||||||
|  | @ -85,7 +85,7 @@ var supportedHostKeyAlgos = []string{ | ||||||
| // This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
 | // This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
 | ||||||
| // because they have reached the end of their useful life.
 | // because they have reached the end of their useful life.
 | ||||||
| var supportedMACs = []string{ | var supportedMACs = []string{ | ||||||
| 	"hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", | 	"hmac-sha2-512-etm@openssh.com", "hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var supportedCompressions = []string{compressionNone} | var supportedCompressions = []string{compressionNone} | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ import ( | ||||||
| 	"crypto/hmac" | 	"crypto/hmac" | ||||||
| 	"crypto/sha1" | 	"crypto/sha1" | ||||||
| 	"crypto/sha256" | 	"crypto/sha256" | ||||||
|  | 	"crypto/sha512" | ||||||
| 	"hash" | 	"hash" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -46,6 +47,9 @@ func (t truncatingMAC) Size() int { | ||||||
| func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } | func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } | ||||||
| 
 | 
 | ||||||
| var macModes = map[string]*macMode{ | var macModes = map[string]*macMode{ | ||||||
|  | 	"hmac-sha2-512-etm@openssh.com": {64, true, func(key []byte) hash.Hash { | ||||||
|  | 		return hmac.New(sha512.New, key) | ||||||
|  | 	}}, | ||||||
| 	"hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash { | 	"hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash { | ||||||
| 		return hmac.New(sha256.New, key) | 		return hmac.New(sha256.New, key) | ||||||
| 	}}, | 	}}, | ||||||
|  |  | ||||||
|  | @ -441,7 +441,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { | ||||||
| 	if s.NewWriteScheduler != nil { | 	if s.NewWriteScheduler != nil { | ||||||
| 		sc.writeSched = s.NewWriteScheduler() | 		sc.writeSched = s.NewWriteScheduler() | ||||||
| 	} else { | 	} else { | ||||||
| 		sc.writeSched = NewPriorityWriteScheduler(nil) | 		sc.writeSched = newRoundRobinWriteScheduler() | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// These start at the RFC-specified defaults. If there is a higher
 | 	// These start at the RFC-specified defaults. If there is a higher
 | ||||||
|  | @ -2429,7 +2429,7 @@ type requestBody struct { | ||||||
| 	conn          *serverConn | 	conn          *serverConn | ||||||
| 	closeOnce     sync.Once // for use by Close only
 | 	closeOnce     sync.Once // for use by Close only
 | ||||||
| 	sawEOF        bool      // for use by Read only
 | 	sawEOF        bool      // for use by Read only
 | ||||||
| 	pipe          *pipe     // non-nil if we have a HTTP entity message body
 | 	pipe          *pipe     // non-nil if we have an HTTP entity message body
 | ||||||
| 	needsContinue bool      // need to send a 100-continue
 | 	needsContinue bool      // need to send a 100-continue
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -2569,7 +2569,8 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { | ||||||
| 				clen = "" | 				clen = "" | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		if clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { | 		_, hasContentLength := rws.snapHeader["Content-Length"] | ||||||
|  | 		if !hasContentLength && clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { | ||||||
| 			clen = strconv.Itoa(len(p)) | 			clen = strconv.Itoa(len(p)) | ||||||
| 		} | 		} | ||||||
| 		_, hasContentType := rws.snapHeader["Content-Type"] | 		_, hasContentType := rws.snapHeader["Content-Type"] | ||||||
|  | @ -2774,7 +2775,7 @@ func (w *responseWriter) FlushError() error { | ||||||
| 		err = rws.bw.Flush() | 		err = rws.bw.Flush() | ||||||
| 	} else { | 	} else { | ||||||
| 		// The bufio.Writer won't call chunkWriter.Write
 | 		// The bufio.Writer won't call chunkWriter.Write
 | ||||||
| 		// (writeChunk with zero bytes, so we have to do it
 | 		// (writeChunk with zero bytes), so we have to do it
 | ||||||
| 		// ourselves to force the HTTP response header and/or
 | 		// ourselves to force the HTTP response header and/or
 | ||||||
| 		// final DATA frame (with END_STREAM) to be sent.
 | 		// final DATA frame (with END_STREAM) to be sent.
 | ||||||
| 		_, err = chunkWriter{rws}.Write(nil) | 		_, err = chunkWriter{rws}.Write(nil) | ||||||
|  |  | ||||||
|  | @ -1268,8 +1268,8 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { | ||||||
| 
 | 
 | ||||||
| 	cancelRequest := func(cs *clientStream, err error) error { | 	cancelRequest := func(cs *clientStream, err error) error { | ||||||
| 		cs.cc.mu.Lock() | 		cs.cc.mu.Lock() | ||||||
| 		defer cs.cc.mu.Unlock() |  | ||||||
| 		cs.abortStreamLocked(err) | 		cs.abortStreamLocked(err) | ||||||
|  | 		bodyClosed := cs.reqBodyClosed | ||||||
| 		if cs.ID != 0 { | 		if cs.ID != 0 { | ||||||
| 			// This request may have failed because of a problem with the connection,
 | 			// This request may have failed because of a problem with the connection,
 | ||||||
| 			// or for some unrelated reason. (For example, the user might have canceled
 | 			// or for some unrelated reason. (For example, the user might have canceled
 | ||||||
|  | @ -1284,6 +1284,23 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { | ||||||
| 			// will not help.
 | 			// will not help.
 | ||||||
| 			cs.cc.doNotReuse = true | 			cs.cc.doNotReuse = true | ||||||
| 		} | 		} | ||||||
|  | 		cs.cc.mu.Unlock() | ||||||
|  | 		// Wait for the request body to be closed.
 | ||||||
|  | 		//
 | ||||||
|  | 		// If nothing closed the body before now, abortStreamLocked
 | ||||||
|  | 		// will have started a goroutine to close it.
 | ||||||
|  | 		//
 | ||||||
|  | 		// Closing the body before returning avoids a race condition
 | ||||||
|  | 		// with net/http checking its readTrackingBody to see if the
 | ||||||
|  | 		// body was read from or closed. See golang/go#60041.
 | ||||||
|  | 		//
 | ||||||
|  | 		// The body is closed in a separate goroutine without the
 | ||||||
|  | 		// connection mutex held, but dropping the mutex before waiting
 | ||||||
|  | 		// will keep us from holding it indefinitely if the body
 | ||||||
|  | 		// close is slow for some reason.
 | ||||||
|  | 		if bodyClosed != nil { | ||||||
|  | 			<-bodyClosed | ||||||
|  | 		} | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -1899,7 +1916,7 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail | ||||||
| 		// 8.1.2.3 Request Pseudo-Header Fields
 | 		// 8.1.2.3 Request Pseudo-Header Fields
 | ||||||
| 		// The :path pseudo-header field includes the path and query parts of the
 | 		// The :path pseudo-header field includes the path and query parts of the
 | ||||||
| 		// target URI (the path-absolute production and optionally a '?' character
 | 		// target URI (the path-absolute production and optionally a '?' character
 | ||||||
| 		// followed by the query production (see Sections 3.3 and 3.4 of
 | 		// followed by the query production, see Sections 3.3 and 3.4 of
 | ||||||
| 		// [RFC3986]).
 | 		// [RFC3986]).
 | ||||||
| 		f(":authority", host) | 		f(":authority", host) | ||||||
| 		m := req.Method | 		m := req.Method | ||||||
|  |  | ||||||
|  | @ -185,6 +185,7 @@ func (wr *FrameWriteRequest) replyToWriter(err error) { | ||||||
| // writeQueue is used by implementations of WriteScheduler.
 | // writeQueue is used by implementations of WriteScheduler.
 | ||||||
| type writeQueue struct { | type writeQueue struct { | ||||||
| 	s          []FrameWriteRequest | 	s          []FrameWriteRequest | ||||||
|  | 	prev, next *writeQueue | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (q *writeQueue) empty() bool { return len(q.s) == 0 } | func (q *writeQueue) empty() bool { return len(q.s) == 0 } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,119 @@ | ||||||
|  | // Copyright 2023 The Go Authors. All rights reserved.
 | ||||||
|  | // Use of this source code is governed by a BSD-style
 | ||||||
|  | // license that can be found in the LICENSE file.
 | ||||||
|  | 
 | ||||||
|  | package http2 | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"fmt" | ||||||
|  | 	"math" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | type roundRobinWriteScheduler struct { | ||||||
|  | 	// control contains control frames (SETTINGS, PING, etc.).
 | ||||||
|  | 	control writeQueue | ||||||
|  | 
 | ||||||
|  | 	// streams maps stream ID to a queue.
 | ||||||
|  | 	streams map[uint32]*writeQueue | ||||||
|  | 
 | ||||||
|  | 	// stream queues are stored in a circular linked list.
 | ||||||
|  | 	// head is the next stream to write, or nil if there are no streams open.
 | ||||||
|  | 	head *writeQueue | ||||||
|  | 
 | ||||||
|  | 	// pool of empty queues for reuse.
 | ||||||
|  | 	queuePool writeQueuePool | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // newRoundRobinWriteScheduler constructs a new write scheduler.
 | ||||||
|  | // The round robin scheduler priorizes control frames
 | ||||||
|  | // like SETTINGS and PING over DATA frames.
 | ||||||
|  | // When there are no control frames to send, it performs a round-robin
 | ||||||
|  | // selection from the ready streams.
 | ||||||
|  | func newRoundRobinWriteScheduler() WriteScheduler { | ||||||
|  | 	ws := &roundRobinWriteScheduler{ | ||||||
|  | 		streams: make(map[uint32]*writeQueue), | ||||||
|  | 	} | ||||||
|  | 	return ws | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (ws *roundRobinWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { | ||||||
|  | 	if ws.streams[streamID] != nil { | ||||||
|  | 		panic(fmt.Errorf("stream %d already opened", streamID)) | ||||||
|  | 	} | ||||||
|  | 	q := ws.queuePool.get() | ||||||
|  | 	ws.streams[streamID] = q | ||||||
|  | 	if ws.head == nil { | ||||||
|  | 		ws.head = q | ||||||
|  | 		q.next = q | ||||||
|  | 		q.prev = q | ||||||
|  | 	} else { | ||||||
|  | 		// Queues are stored in a ring.
 | ||||||
|  | 		// Insert the new stream before ws.head, putting it at the end of the list.
 | ||||||
|  | 		q.prev = ws.head.prev | ||||||
|  | 		q.next = ws.head | ||||||
|  | 		q.prev.next = q | ||||||
|  | 		q.next.prev = q | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (ws *roundRobinWriteScheduler) CloseStream(streamID uint32) { | ||||||
|  | 	q := ws.streams[streamID] | ||||||
|  | 	if q == nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	if q.next == q { | ||||||
|  | 		// This was the only open stream.
 | ||||||
|  | 		ws.head = nil | ||||||
|  | 	} else { | ||||||
|  | 		q.prev.next = q.next | ||||||
|  | 		q.next.prev = q.prev | ||||||
|  | 		if ws.head == q { | ||||||
|  | 			ws.head = q.next | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	delete(ws.streams, streamID) | ||||||
|  | 	ws.queuePool.put(q) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (ws *roundRobinWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {} | ||||||
|  | 
 | ||||||
|  | func (ws *roundRobinWriteScheduler) Push(wr FrameWriteRequest) { | ||||||
|  | 	if wr.isControl() { | ||||||
|  | 		ws.control.push(wr) | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	q := ws.streams[wr.StreamID()] | ||||||
|  | 	if q == nil { | ||||||
|  | 		// This is a closed stream.
 | ||||||
|  | 		// wr should not be a HEADERS or DATA frame.
 | ||||||
|  | 		// We push the request onto the control queue.
 | ||||||
|  | 		if wr.DataSize() > 0 { | ||||||
|  | 			panic("add DATA on non-open stream") | ||||||
|  | 		} | ||||||
|  | 		ws.control.push(wr) | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	q.push(wr) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (ws *roundRobinWriteScheduler) Pop() (FrameWriteRequest, bool) { | ||||||
|  | 	// Control and RST_STREAM frames first.
 | ||||||
|  | 	if !ws.control.empty() { | ||||||
|  | 		return ws.control.shift(), true | ||||||
|  | 	} | ||||||
|  | 	if ws.head == nil { | ||||||
|  | 		return FrameWriteRequest{}, false | ||||||
|  | 	} | ||||||
|  | 	q := ws.head | ||||||
|  | 	for { | ||||||
|  | 		if wr, ok := q.consume(math.MaxInt32); ok { | ||||||
|  | 			ws.head = q.next | ||||||
|  | 			return wr, true | ||||||
|  | 		} | ||||||
|  | 		q = q.next | ||||||
|  | 		if q == ws.head { | ||||||
|  | 			break | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	return FrameWriteRequest{}, false | ||||||
|  | } | ||||||
|  | @ -849,7 +849,7 @@ go.opencensus.io/trace/propagation | ||||||
| go.opencensus.io/trace/tracestate | go.opencensus.io/trace/tracestate | ||||||
| # go.uber.org/goleak v1.2.1 | # go.uber.org/goleak v1.2.1 | ||||||
| ## explicit; go 1.18 | ## explicit; go 1.18 | ||||||
| # golang.org/x/crypto v0.9.0 | # golang.org/x/crypto v0.10.0 | ||||||
| ## explicit; go 1.17 | ## explicit; go 1.17 | ||||||
| golang.org/x/crypto/argon2 | golang.org/x/crypto/argon2 | ||||||
| golang.org/x/crypto/blake2b | golang.org/x/crypto/blake2b | ||||||
|  | @ -875,7 +875,7 @@ golang.org/x/crypto/ssh/knownhosts | ||||||
| # golang.org/x/mod v0.10.0 | # golang.org/x/mod v0.10.0 | ||||||
| ## explicit; go 1.17 | ## explicit; go 1.17 | ||||||
| golang.org/x/mod/semver | golang.org/x/mod/semver | ||||||
| # golang.org/x/net v0.10.0 | # golang.org/x/net v0.11.0 | ||||||
| ## explicit; go 1.17 | ## explicit; go 1.17 | ||||||
| golang.org/x/net/context | golang.org/x/net/context | ||||||
| golang.org/x/net/http/httpguts | golang.org/x/net/http/httpguts | ||||||
|  | @ -887,7 +887,7 @@ golang.org/x/net/internal/socks | ||||||
| golang.org/x/net/internal/timeseries | golang.org/x/net/internal/timeseries | ||||||
| golang.org/x/net/proxy | golang.org/x/net/proxy | ||||||
| golang.org/x/net/trace | golang.org/x/net/trace | ||||||
| # golang.org/x/oauth2 v0.8.0 | # golang.org/x/oauth2 v0.9.0 | ||||||
| ## explicit; go 1.17 | ## explicit; go 1.17 | ||||||
| golang.org/x/oauth2 | golang.org/x/oauth2 | ||||||
| golang.org/x/oauth2/authhandler | golang.org/x/oauth2/authhandler | ||||||
|  | @ -908,7 +908,7 @@ golang.org/x/sys/internal/unsafeheader | ||||||
| golang.org/x/sys/unix | golang.org/x/sys/unix | ||||||
| golang.org/x/sys/windows | golang.org/x/sys/windows | ||||||
| golang.org/x/sys/windows/registry | golang.org/x/sys/windows/registry | ||||||
| # golang.org/x/text v0.9.0 | # golang.org/x/text v0.10.0 | ||||||
| ## explicit; go 1.17 | ## explicit; go 1.17 | ||||||
| golang.org/x/text/runes | golang.org/x/text/runes | ||||||
| golang.org/x/text/secure/bidirule | golang.org/x/text/secure/bidirule | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue