make Config.Allow0RTT a bool, not a callback

This commit is contained in:
Marten Seemann
2023-03-22 13:25:09 +13:00
parent bc7cb706c5
commit 7a0ef5f867
10 changed files with 35 additions and 49 deletions

View File

@@ -46,6 +46,7 @@ func main() {
// a quic.Config that doesn't do a Retry
quicConf := &quic.Config{
RequireAddressValidation: func(net.Addr) bool { return testcase == "retry" },
Allow0RTT: testcase == "zerortt",
Tracer: qlog.NewTracer(getLogWriter),
}
cert, err := tls.LoadX509KeyPair("/certs/cert.pem", "/certs/priv.key")
@@ -59,10 +60,7 @@ func main() {
}
switch testcase {
case "zerortt":
quicConf.Allow0RTT = func(net.Addr) bool { return true }
fallthrough
case "versionnegotiation", "handshake", "retry", "transfer", "resumption", "multiconnect":
case "versionnegotiation", "handshake", "retry", "transfer", "resumption", "multiconnect", "zerortt":
err = runHTTP09Server(quicConf)
case "chacha20":
reset := qtls.SetCipherSuite(tls.TLS_CHACHA20_POLY1305_SHA256)