Repository: quic-go/quic-go
Pull request #4385 (2024-03-23 21:01:27)

http3: rename RoundTripper.QuicConfig to RoundTripper.QUICConfig

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/quic-go/quic-go/pull/4385?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 85.32%. Comparing base [(`dc0491a`)](https://app.codecov.io/gh/quic-go/quic-go/commit/dc0491a75a3265955f2fdcdf65da905a1222bcca?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go) to head [(`a2a91ba`)](https://app.codecov.io/gh/quic-go/quic-go/pull/4385?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go).


<details><summary>Additional details and impacted files</summary>


```diff
@@                     Coverage Diff                     @@
##           http3-server-quicconfig    #4385      +/-   ##
===========================================================
+ Coverage                    84.88%   85.32%   +0.43%     
===========================================================
  Files                          151      148       -3     
  Lines                        14343    12796    -1547     
===========================================================
- Hits                         12175    10917    -1258     
+ Misses                        1669     1383     -286     
+ Partials                       499      496       -3     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/quic-go/quic-go/pull/4385?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go).


Patch:
diff --git a/example/client/main.go b/example/client/main.go
index 31b1a416..c759855a 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 d297531c..8308cdc8 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/interop/client/main.go b/interop/client/main.go
index a433e443..d8198f9c 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)


Test patch:
diff --git a/http3/roundtrip_test.go b/http3/roundtrip_test.go
index 1ab767c9..2df4294e 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 5252dd93..4091cda6 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 1093803a..8e57d906 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()