add Allow0RTT opt in the quic.Config to control 0-RTT on the server side (#3635)

This commit is contained in:
Marten Seemann
2023-01-04 16:18:11 -08:00
committed by GitHub
parent 421893b1c4
commit b52d34008f
12 changed files with 98 additions and 51 deletions

View File

@@ -390,6 +390,10 @@ func runHandshake(runConfig [confLen]byte, messageConfig uint8, clientConf *tls.
protocol.VersionTLS,
)
var allow0RTT func() bool
if enable0RTTServer {
allow0RTT = func() bool { return true }
}
sChunkChan, sInitialStream, sHandshakeStream := initStreams()
server = handshake.NewCryptoSetupServer(
sInitialStream,
@@ -400,7 +404,7 @@ func runHandshake(runConfig [confLen]byte, messageConfig uint8, clientConf *tls.
serverTP,
runner,
serverConf,
enable0RTTServer,
allow0RTT,
utils.NewRTTStats(),
nil,
utils.DefaultLogger.WithPrefix("server"),