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

@ -72,7 +72,7 @@ type baseServer struct {
sessionHandler packetHandlerManager
// set as a member, so they can be set in the tests
newSession func(connection, sessionRunner, protocol.ConnectionID /* original connection ID */, protocol.ConnectionID /* client dest connection ID */, protocol.ConnectionID /* destination connection ID */, protocol.ConnectionID /* source connection ID */, [16]byte, *Config, *tls.Config, *handshake.TokenGenerator, utils.Logger, protocol.VersionNumber) quicSession
newSession func(connection, sessionRunner, protocol.ConnectionID /* original connection ID */, protocol.ConnectionID /* client dest connection ID */, protocol.ConnectionID /* destination connection ID */, protocol.ConnectionID /* source connection ID */, [16]byte, *Config, *tls.Config, *handshake.TokenGenerator, bool /* enable 0-RTT */, utils.Logger, protocol.VersionNumber) quicSession
serverError error
errorChan chan struct{}
@ -450,6 +450,7 @@ func (s *baseServer) createNewSession(
s.config,
s.tlsConf,
s.tokenGenerator,
s.acceptEarlySessions,
s.logger,
version,
)