From e265abb8cb27a3bfa465a4fd15fe92b47a41883e Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 3 Aug 2018 16:22:37 +0700 Subject: [PATCH] fix populating the client config when dialing an address --- client.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 551800e4..84dad27d 100644 --- a/client.go +++ b/client.go @@ -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 {