From 49b99655254706256364748c8fce3fb71c553977 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 24 Mar 2024 08:29:39 +1000 Subject: [PATCH] http3: rename RoundTripper.QuicConfig to RoundTripper.QUICConfig (#4385) --- example/client/main.go | 2 +- http3/roundtrip.go | 8 ++++---- http3/roundtrip_test.go | 6 +++--- integrationtests/self/hotswap_test.go | 2 +- integrationtests/self/http_test.go | 6 +++--- interop/client/main.go | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/example/client/main.go b/example/client/main.go index 31b1a416d..c759855ad 100644 --- a/example/client/main.go +++ b/example/client/main.go @@ -46,7 +46,7 @@ func main() { InsecureSkipVerify: *insecure, KeyLogWriter: keyLog, }, - QuicConfig: &quic.Config{ + QUICConfig: &quic.Config{ Tracer: qlog.DefaultTracer, }, } diff --git a/http3/roundtrip.go b/http3/roundtrip.go index d297531c2..8308cdc8c 100644 --- a/http3/roundtrip.go +++ b/http3/roundtrip.go @@ -70,12 +70,12 @@ type RoundTripper struct { // tls.Client. If nil, the default configuration is used. TLSClientConfig *tls.Config - // QuicConfig is the quic.Config used for dialing new connections. + // QUICConfig is the quic.Config used for dialing new connections. // If nil, reasonable default values will be used. - QuicConfig *quic.Config + QUICConfig *quic.Config // Enable support for HTTP/3 datagrams (RFC 9297). - // If a QuicConfig is set, datagram support also needs to be enabled on the QUIC layer by setting EnableDatagrams. + // If a QUICConfig is set, datagram support also needs to be enabled on the QUIC layer by setting EnableDatagrams. EnableDatagrams bool // Additional HTTP/3 settings. @@ -217,7 +217,7 @@ func (r *RoundTripper) getClient(hostname string, onlyCached bool) (rtc *roundTr UniStreamHijacker: r.UniStreamHijacker, AdditionalSettings: r.AdditionalSettings, }, - r.QuicConfig, + r.QUICConfig, dial, ) if err != nil { diff --git a/http3/roundtrip_test.go b/http3/roundtrip_test.go index 1ab767c95..2df4294e8 100644 --- a/http3/roundtrip_test.go +++ b/http3/roundtrip_test.go @@ -93,21 +93,21 @@ var _ = Describe("RoundTripper", func() { receivedConfig = config return nil, errors.New("handshake error") } - rt.QuicConfig = config + rt.QUICConfig = config _, err := rt.RoundTrip(req) Expect(err).To(MatchError("handshake error")) Expect(receivedConfig.HandshakeIdleTimeout).To(Equal(config.HandshakeIdleTimeout)) }) It("requires quic.Config.EnableDatagram if HTTP datagrams are enabled", func() { - rt.QuicConfig = &quic.Config{EnableDatagrams: false} + rt.QUICConfig = &quic.Config{EnableDatagrams: false} rt.Dial = func(_ context.Context, _ string, _ *tls.Config, config *quic.Config) (quic.EarlyConnection, error) { return nil, errors.New("handshake error") } rt.EnableDatagrams = true _, err := rt.RoundTrip(req) Expect(err).To(MatchError("HTTP Datagrams enabled, but QUIC Datagrams disabled")) - rt.QuicConfig.EnableDatagrams = true + rt.QUICConfig.EnableDatagrams = true _, err = rt.RoundTrip(req) Expect(err).To(MatchError("handshake error")) }) diff --git a/integrationtests/self/hotswap_test.go b/integrationtests/self/hotswap_test.go index 5252dd939..4091cda6a 100644 --- a/integrationtests/self/hotswap_test.go +++ b/integrationtests/self/hotswap_test.go @@ -110,7 +110,7 @@ var _ = Describe("HTTP3 Server hotswap test", func() { rt = &http3.RoundTripper{ TLSClientConfig: getTLSClientConfig(), DisableCompression: true, - QuicConfig: getQuicConfig(&quic.Config{MaxIdleTimeout: 10 * time.Second}), + QUICConfig: getQuicConfig(&quic.Config{MaxIdleTimeout: 10 * time.Second}), } client = &http.Client{Transport: rt} }) diff --git a/integrationtests/self/http_test.go b/integrationtests/self/http_test.go index 1093803a2..8e57d906d 100644 --- a/integrationtests/self/http_test.go +++ b/integrationtests/self/http_test.go @@ -116,7 +116,7 @@ var _ = Describe("HTTP tests", func() { BeforeEach(func() { rt = &http3.RoundTripper{ TLSClientConfig: getTLSClientConfigWithoutServerName(), - QuicConfig: getQuicConfig(&quic.Config{ + QUICConfig: getQuicConfig(&quic.Config{ MaxIdleTimeout: 10 * time.Second, Allow0RTT: true, }), @@ -604,7 +604,7 @@ var _ = Describe("HTTP tests", func() { tlsConf.ClientSessionCache = newClientSessionCache(tls.NewLRUClientSessionCache(10), nil, puts) rt := &http3.RoundTripper{ TLSClientConfig: tlsConf, - QuicConfig: getQuicConfig(&quic.Config{ + QUICConfig: getQuicConfig(&quic.Config{ MaxIdleTimeout: 10 * time.Second, Allow0RTT: true, }), @@ -628,7 +628,7 @@ var _ = Describe("HTTP tests", func() { rt2 := &http3.RoundTripper{ TLSClientConfig: rt.TLSClientConfig, - QuicConfig: rt.QuicConfig, + QUICConfig: rt.QUICConfig, DisableCompression: true, } defer rt2.Close() diff --git a/interop/client/main.go b/interop/client/main.go index a433e4435..d8198f9c5 100644 --- a/interop/client/main.go +++ b/interop/client/main.go @@ -69,7 +69,7 @@ func runTestcase(testcase string) error { if testcase == "http3" { r := &http3.RoundTripper{ TLSClientConfig: tlsConf, - QuicConfig: quicConf, + QUICConfig: quicConf, } defer r.Close() return downloadFiles(r, urls, false)