mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
move the transport parameter stream limit check to the parser
This commit is contained in:
parent
6217ec55fd
commit
c7d3aeea3d
6 changed files with 50 additions and 38 deletions
|
@ -279,8 +279,14 @@ func (p *TransportParameters) readNumericTransportParameter(
|
|||
p.InitialMaxData = protocol.ByteCount(val)
|
||||
case initialMaxStreamsBidiParameterID:
|
||||
p.MaxBidiStreamNum = protocol.StreamNum(val)
|
||||
if p.MaxBidiStreamNum > protocol.MaxStreamCount {
|
||||
return fmt.Errorf("initial_max_streams_bidi too large: %d (maximum %d)", p.MaxBidiStreamNum, protocol.MaxStreamCount)
|
||||
}
|
||||
case initialMaxStreamsUniParameterID:
|
||||
p.MaxUniStreamNum = protocol.StreamNum(val)
|
||||
if p.MaxUniStreamNum > protocol.MaxStreamCount {
|
||||
return fmt.Errorf("initial_max_streams_uni too large: %d (maximum %d)", p.MaxUniStreamNum, protocol.MaxStreamCount)
|
||||
}
|
||||
case maxIdleTimeoutParameterID:
|
||||
p.MaxIdleTimeout = utils.MaxDuration(protocol.MinRemoteIdleTimeout, time.Duration(val)*time.Millisecond)
|
||||
case maxUDPPayloadSizeParameterID:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue