mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
Merge pull request #3359 from lucas-clemente/http3-dial-context
respect the request context when dialing
This commit is contained in:
commit
42f3159497
4 changed files with 42 additions and 46 deletions
|
@ -82,7 +82,7 @@ var _ = Describe("RoundTripper", func() {
|
|||
BeforeEach(func() {
|
||||
session = mockquic.NewMockEarlySession(mockCtrl)
|
||||
origDialAddr = dialAddr
|
||||
dialAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.EarlySession, error) {
|
||||
dialAddr = func(context.Context, string, *tls.Config, *quic.Config) (quic.EarlySession, error) {
|
||||
// return an error when trying to open a stream
|
||||
// we don't want to test all the dial logic here, just that dialing happens at all
|
||||
return session, nil
|
||||
|
@ -115,7 +115,7 @@ var _ = Describe("RoundTripper", func() {
|
|||
It("uses the quic.Config, if provided", func() {
|
||||
config := &quic.Config{HandshakeIdleTimeout: time.Millisecond}
|
||||
var receivedConfig *quic.Config
|
||||
dialAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.EarlySession, error) {
|
||||
dialAddr = func(_ context.Context, _ string, _ *tls.Config, config *quic.Config) (quic.EarlySession, error) {
|
||||
receivedConfig = config
|
||||
return nil, errors.New("handshake error")
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ var _ = Describe("RoundTripper", func() {
|
|||
|
||||
It("uses the custom dialer, if provided", func() {
|
||||
var dialed bool
|
||||
dialer := func(_, _ string, tlsCfgP *tls.Config, cfg *quic.Config) (quic.EarlySession, error) {
|
||||
dialer := func(_ context.Context, _, _ string, tlsCfgP *tls.Config, cfg *quic.Config) (quic.EarlySession, error) {
|
||||
dialed = true
|
||||
return nil, errors.New("handshake error")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue