forked from quic-go/quic-go
add Allow0RTT opt in the quic.Config to control 0-RTT on the server side (#3635)
This commit is contained in:
@@ -241,7 +241,6 @@ var newConnection = func(
|
||||
conf *Config,
|
||||
tlsConf *tls.Config,
|
||||
tokenGenerator *handshake.TokenGenerator,
|
||||
enable0RTT bool,
|
||||
clientAddressValidated bool,
|
||||
tracer logging.ConnectionTracer,
|
||||
tracingID uint64,
|
||||
@@ -323,6 +322,10 @@ var newConnection = func(
|
||||
if s.tracer != nil {
|
||||
s.tracer.SentTransportParameters(params)
|
||||
}
|
||||
var allow0RTT func() bool
|
||||
if conf.Allow0RTT != nil {
|
||||
allow0RTT = func() bool { return conf.Allow0RTT(conn.RemoteAddr()) }
|
||||
}
|
||||
cs := handshake.NewCryptoSetupServer(
|
||||
initialStream,
|
||||
handshakeStream,
|
||||
@@ -340,7 +343,7 @@ var newConnection = func(
|
||||
},
|
||||
},
|
||||
tlsConf,
|
||||
enable0RTT,
|
||||
allow0RTT,
|
||||
s.rttStats,
|
||||
tracer,
|
||||
logger,
|
||||
|
||||
Reference in New Issue
Block a user