allow 0-RTT resumption if the server's stream limit was increased

This commit is contained in:
Marten Seemann 2021-03-10 14:16:18 +08:00
parent 3bce408c8d
commit 3588cddd43
4 changed files with 83 additions and 22 deletions

View file

@ -440,14 +440,14 @@ func (p *TransportParameters) UnmarshalFromSessionTicket(r *bytes.Reader) error
}
// ValidFor0RTT checks if the transport parameters match those saved in the session ticket.
func (p *TransportParameters) ValidFor0RTT(tp *TransportParameters) bool {
return p.InitialMaxStreamDataBidiLocal == tp.InitialMaxStreamDataBidiLocal &&
p.InitialMaxStreamDataBidiRemote == tp.InitialMaxStreamDataBidiRemote &&
p.InitialMaxStreamDataUni == tp.InitialMaxStreamDataUni &&
p.InitialMaxData == tp.InitialMaxData &&
p.MaxBidiStreamNum == tp.MaxBidiStreamNum &&
p.MaxUniStreamNum == tp.MaxUniStreamNum &&
p.ActiveConnectionIDLimit == tp.ActiveConnectionIDLimit
func (p *TransportParameters) ValidFor0RTT(saved *TransportParameters) bool {
return p.InitialMaxStreamDataBidiLocal == saved.InitialMaxStreamDataBidiLocal &&
p.InitialMaxStreamDataBidiRemote == saved.InitialMaxStreamDataBidiRemote &&
p.InitialMaxStreamDataUni == saved.InitialMaxStreamDataUni &&
p.InitialMaxData == saved.InitialMaxData &&
p.MaxBidiStreamNum >= saved.MaxBidiStreamNum &&
p.MaxUniStreamNum >= saved.MaxUniStreamNum &&
p.ActiveConnectionIDLimit == saved.ActiveConnectionIDLimit
}
// String returns a string representation, intended for logging.