only enable 0-RTT when using ListenEarly and DialEarly

This commit is contained in:
Marten Seemann 2020-01-17 10:47:50 +07:00
parent 39efdfe695
commit eeba3951ae
7 changed files with 57 additions and 30 deletions

View file

@ -202,6 +202,7 @@ var newSession = func(
conf *Config,
tlsConf *tls.Config,
tokenGenerator *handshake.TokenGenerator,
enable0RTT bool,
logger utils.Logger,
v protocol.VersionNumber,
) quicSession {
@ -274,7 +275,7 @@ var newSession = func(
},
},
tlsConf,
true, // TODO: make 0-RTT support configurable
enable0RTT,
s.rttStats,
logger,
)
@ -308,6 +309,7 @@ var newClientSession = func(
tlsConf *tls.Config,
initialPacketNumber protocol.PacketNumber,
initialVersion protocol.VersionNumber,
enable0RTT bool,
logger utils.Logger,
v protocol.VersionNumber,
) quicSession {
@ -371,7 +373,7 @@ var newClientSession = func(
onHandshakeComplete: func() { close(s.handshakeCompleteChan) },
},
tlsConf,
true, // TODO: make 0-RTT support configurable
enable0RTT,
s.rttStats,
logger,
)