@@ -57,11 +57,11 @@ func DialAddr(ctx context.Context, addr string, tlsConf *tls.Config, conf *Confi
5757 if err != nil {
5858 return nil , err
5959 }
60- dl , err := setupTransport (udpConn , tlsConf , true )
60+ tr , err := setupTransport (udpConn , tlsConf , true )
6161 if err != nil {
6262 return nil , err
6363 }
64- return dl . Dial (ctx , udpAddr , tlsConf , conf )
64+ return tr . dial (ctx , udpAddr , addr , tlsConf , conf , false )
6565}
6666
6767// DialAddrEarly establishes a new 0-RTT QUIC connection to a server.
@@ -75,13 +75,13 @@ func DialAddrEarly(ctx context.Context, addr string, tlsConf *tls.Config, conf *
7575 if err != nil {
7676 return nil , err
7777 }
78- dl , err := setupTransport (udpConn , tlsConf , true )
78+ tr , err := setupTransport (udpConn , tlsConf , true )
7979 if err != nil {
8080 return nil , err
8181 }
82- conn , err := dl . DialEarly (ctx , udpAddr , tlsConf , conf )
82+ conn , err := tr . dial (ctx , udpAddr , addr , tlsConf , conf , true )
8383 if err != nil {
84- dl .Close ()
84+ tr .Close ()
8585 return nil , err
8686 }
8787 return conn , nil
@@ -166,12 +166,6 @@ func dial(
166166}
167167
168168func newClient (sendConn sendConn , connIDGenerator ConnectionIDGenerator , config * Config , tlsConf * tls.Config , onClose func (), use0RTT bool ) (* client , error ) {
169- if tlsConf == nil {
170- tlsConf = & tls.Config {}
171- } else {
172- tlsConf = tlsConf .Clone ()
173- }
174-
175169 srcConnID , err := connIDGenerator .GenerateConnectionID ()
176170 if err != nil {
177171 return nil , err
0 commit comments