clean up dial functions

* add a context to all Dial functions
* remove the explicit Dial{*}Context functions
This commit is contained in:
Marten Seemann
2023-04-06 18:32:46 +08:00
parent d683b841c4
commit aee7706d5d
32 changed files with 106 additions and 59 deletions

View File

@@ -36,7 +36,7 @@ func BenchmarkHandshake(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
c, err := quic.Dial(conn, ln.Addr(), tlsClientConfig, nil)
c, err := quic.Dial(context.Background(), conn, ln.Addr(), tlsClientConfig, nil)
if err != nil {
b.Fatal(err)
}
@@ -71,7 +71,7 @@ func BenchmarkStreamChurn(b *testing.B) {
}
}()
c, err := quic.DialAddr(fmt.Sprintf("localhost:%d", ln.Addr().(*net.UDPAddr).Port), tlsClientConfig, nil)
c, err := quic.DialAddr(context.Background(), fmt.Sprintf("localhost:%d", ln.Addr().(*net.UDPAddr).Port), tlsClientConfig, nil)
if err != nil {
b.Fatal(err)
}