forked from quic-go/quic-go
fix populating the client config when dialing an address
This commit is contained in:
13
client.go
13
client.go
@@ -82,7 +82,7 @@ func DialAddrContext(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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.
|
// Dial establishes a new QUIC connection to a server using a net.PacketConn.
|
||||||
@@ -108,6 +108,17 @@ func DialContext(
|
|||||||
config *Config,
|
config *Config,
|
||||||
) (Session, error) {
|
) (Session, error) {
|
||||||
config = populateClientConfig(config, true)
|
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()
|
multiplexer := getClientMultiplexer()
|
||||||
manager, err := multiplexer.AddConn(pconn, config.ConnectionIDLength)
|
manager, err := multiplexer.AddConn(pconn, config.ConnectionIDLength)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user