store the RTT in the token, not in the session ticket (#5065)

* remove RTT from session ticket

* save RTT in token

* use mus as rtt unit in token

* move RTT from session state to token on client side

* Rename the rtt variables

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update internal/handshake/token_generator.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update token_generator.go

* Update connection.go

* Update token_generator.go

* correct slice  access in fuzz.go

* rearrange connection constructor parameters

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This commit is contained in:
Ameame
2025-05-16 18:25:58 +08:00
committed by GitHub
parent eb8547ca73
commit 8ef0a71581
13 changed files with 67 additions and 140 deletions

View File

@@ -96,7 +96,7 @@ func (r *RTTStats) SetMaxAckDelay(mad time.Duration) {
}
// SetInitialRTT sets the initial RTT.
// It is used during the 0-RTT handshake when restoring the RTT stats from the session state.
// It is used during handshake when restoring the RTT stats from the token.
func (r *RTTStats) SetInitialRTT(t time.Duration) {
// On the server side, by the time we get to process the session ticket,
// we might already have obtained an RTT measurement.