fix populating the client config when dialing an address

This commit is contained in:
Marten Seemann
2018-08-03 16:22:37 +07:00
parent e3959f4998
commit e265abb8cb

View File

@@ -82,7 +82,7 @@ func DialAddrContext(
if err != nil {
return nil, err
}
return DialContext(ctx, udpConn, udpAddr, addr, tlsConf, config)
return dialContext(ctx, udpConn, udpAddr, addr, tlsConf, config)
}
// Dial establishes a new QUIC connection to a server using a net.PacketConn.
@@ -108,6 +108,17 @@ func DialContext(
config *Config,
) (Session, error) {
config = populateClientConfig(config, true)
return dialContext(ctx, pconn, remoteAddr, host, tlsConf, config)
}
func dialContext(
ctx context.Context,
pconn net.PacketConn,
remoteAddr net.Addr,
host string,
tlsConf *tls.Config,
config *Config,
) (Session, error) {
multiplexer := getClientMultiplexer()
manager, err := multiplexer.AddConn(pconn, config.ConnectionIDLength)
if err != nil {