remove Config.MaxRetryTokenAge, set it to the handshake timeout (#4064)

There is no good reason to manually set the validity period for Retry
tokens. Retry tokens are only valid on a single connection during the
handshake, so it makes sense to limit their validity to the configured
handshake timeout.
This commit is contained in:
Marten Seemann
2023-09-10 13:53:12 +07:00
committed by GitHub
parent e1fcac3e46
commit abfe1ef548
7 changed files with 25 additions and 16 deletions

View File

@@ -531,7 +531,7 @@ func (s *baseServer) validateToken(token *handshake.Token, addr net.Addr) bool {
if !token.IsRetryToken && time.Since(token.SentTime) > s.config.MaxTokenAge {
return false
}
if token.IsRetryToken && time.Since(token.SentTime) > s.config.MaxRetryTokenAge {
if token.IsRetryToken && time.Since(token.SentTime) > s.config.maxRetryTokenAge() {
return false
}
return true