|
@@ -354,7 +354,8 @@ func Dial(
|
|
|
quicVersion string,
|
|
quicVersion string,
|
|
|
clientHelloSeed *prng.Seed,
|
|
clientHelloSeed *prng.Seed,
|
|
|
obfuscationKey string,
|
|
obfuscationKey string,
|
|
|
- obfuscationPaddingSeed *prng.Seed) (net.Conn, error) {
|
|
|
|
|
|
|
+ obfuscationPaddingSeed *prng.Seed,
|
|
|
|
|
+ disablePathMTUDiscovery bool) (net.Conn, error) {
|
|
|
|
|
|
|
|
if quicVersion == "" {
|
|
if quicVersion == "" {
|
|
|
return nil, errors.TraceNew("missing version")
|
|
return nil, errors.TraceNew("missing version")
|
|
@@ -435,6 +436,7 @@ func Dial(
|
|
|
clientHelloSeed,
|
|
clientHelloSeed,
|
|
|
getClientHelloRandom,
|
|
getClientHelloRandom,
|
|
|
maxPacketSizeAdjustment,
|
|
maxPacketSizeAdjustment,
|
|
|
|
|
+ disablePathMTUDiscovery,
|
|
|
false)
|
|
false)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
packetConn.Close()
|
|
packetConn.Close()
|
|
@@ -638,12 +640,13 @@ func (conn *Conn) SetWriteDeadline(t time.Time) error {
|
|
|
// CloseIdleConnections.
|
|
// CloseIdleConnections.
|
|
|
type QUICTransporter struct {
|
|
type QUICTransporter struct {
|
|
|
quicRoundTripper
|
|
quicRoundTripper
|
|
|
- noticeEmitter func(string)
|
|
|
|
|
- udpDialer func(ctx context.Context) (net.PacketConn, *net.UDPAddr, error)
|
|
|
|
|
- quicSNIAddress string
|
|
|
|
|
- quicVersion string
|
|
|
|
|
- clientHelloSeed *prng.Seed
|
|
|
|
|
- packetConn atomic.Value
|
|
|
|
|
|
|
+ noticeEmitter func(string)
|
|
|
|
|
+ udpDialer func(ctx context.Context) (net.PacketConn, *net.UDPAddr, error)
|
|
|
|
|
+ quicSNIAddress string
|
|
|
|
|
+ quicVersion string
|
|
|
|
|
+ clientHelloSeed *prng.Seed
|
|
|
|
|
+ disablePathMTUDiscovery bool
|
|
|
|
|
+ packetConn atomic.Value
|
|
|
|
|
|
|
|
mutex sync.Mutex
|
|
mutex sync.Mutex
|
|
|
ctx context.Context
|
|
ctx context.Context
|
|
@@ -656,7 +659,8 @@ func NewQUICTransporter(
|
|
|
udpDialer func(ctx context.Context) (net.PacketConn, *net.UDPAddr, error),
|
|
udpDialer func(ctx context.Context) (net.PacketConn, *net.UDPAddr, error),
|
|
|
quicSNIAddress string,
|
|
quicSNIAddress string,
|
|
|
quicVersion string,
|
|
quicVersion string,
|
|
|
- clientHelloSeed *prng.Seed) (*QUICTransporter, error) {
|
|
|
|
|
|
|
+ clientHelloSeed *prng.Seed,
|
|
|
|
|
+ disablePathMTUDiscovery bool) (*QUICTransporter, error) {
|
|
|
|
|
|
|
|
if quicVersion == "" {
|
|
if quicVersion == "" {
|
|
|
return nil, errors.TraceNew("missing version")
|
|
return nil, errors.TraceNew("missing version")
|
|
@@ -672,12 +676,13 @@ func NewQUICTransporter(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
t := &QUICTransporter{
|
|
t := &QUICTransporter{
|
|
|
- noticeEmitter: noticeEmitter,
|
|
|
|
|
- udpDialer: udpDialer,
|
|
|
|
|
- quicSNIAddress: quicSNIAddress,
|
|
|
|
|
- quicVersion: quicVersion,
|
|
|
|
|
- clientHelloSeed: clientHelloSeed,
|
|
|
|
|
- ctx: ctx,
|
|
|
|
|
|
|
+ noticeEmitter: noticeEmitter,
|
|
|
|
|
+ udpDialer: udpDialer,
|
|
|
|
|
+ quicSNIAddress: quicSNIAddress,
|
|
|
|
|
+ quicVersion: quicVersion,
|
|
|
|
|
+ clientHelloSeed: clientHelloSeed,
|
|
|
|
|
+ disablePathMTUDiscovery: disablePathMTUDiscovery,
|
|
|
|
|
+ ctx: ctx,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if isIETFVersionNumber(versionNumber) {
|
|
if isIETFVersionNumber(versionNumber) {
|
|
@@ -764,6 +769,7 @@ func (t *QUICTransporter) dialQUIC() (retSession quicSession, retErr error) {
|
|
|
t.clientHelloSeed,
|
|
t.clientHelloSeed,
|
|
|
nil,
|
|
nil,
|
|
|
0,
|
|
0,
|
|
|
|
|
+ t.disablePathMTUDiscovery,
|
|
|
true)
|
|
true)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
packetConn.Close()
|
|
packetConn.Close()
|
|
@@ -890,6 +896,7 @@ func dialQUIC(
|
|
|
clientHelloSeed *prng.Seed,
|
|
clientHelloSeed *prng.Seed,
|
|
|
getClientHelloRandom func() ([]byte, error),
|
|
getClientHelloRandom func() ([]byte, error),
|
|
|
clientMaxPacketSizeAdjustment int,
|
|
clientMaxPacketSizeAdjustment int,
|
|
|
|
|
+ disablePathMTUDiscovery bool,
|
|
|
dialEarly bool) (quicSession, error) {
|
|
dialEarly bool) (quicSession, error) {
|
|
|
|
|
|
|
|
if isIETFVersionNumber(versionNumber) {
|
|
if isIETFVersionNumber(versionNumber) {
|
|
@@ -902,6 +909,7 @@ func dialQUIC(
|
|
|
ClientHelloSeed: clientHelloSeed,
|
|
ClientHelloSeed: clientHelloSeed,
|
|
|
GetClientHelloRandom: getClientHelloRandom,
|
|
GetClientHelloRandom: getClientHelloRandom,
|
|
|
ClientMaxPacketSizeAdjustment: clientMaxPacketSizeAdjustment,
|
|
ClientMaxPacketSizeAdjustment: clientMaxPacketSizeAdjustment,
|
|
|
|
|
+ DisablePathMTUDiscovery: disablePathMTUDiscovery,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
deadline, ok := ctx.Deadline()
|
|
deadline, ok := ctx.Deadline()
|