Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http3: rename RoundTripper.QuicConfig to RoundTripper.QUICConfig #4385

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func main() {
InsecureSkipVerify: *insecure,
KeyLogWriter: keyLog,
},
QuicConfig: &quic.Config{
QUICConfig: &quic.Config{
Tracer: qlog.DefaultTracer,
},
}
Expand Down
8 changes: 4 additions & 4 deletions http3/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions http3/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
})
Expand Down
2 changes: 1 addition & 1 deletion integrationtests/self/hotswap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
})
Expand Down
6 changes: 3 additions & 3 deletions integrationtests/self/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down Expand Up @@ -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,
}),
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion interop/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading