mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
Merge pull request #2995 from lucas-clemente/simplify-tp-parsing-switch
simplify switch statement in the transport parameter parser
This commit is contained in:
commit
cafa7c45d0
1 changed files with 7 additions and 13 deletions
|
@ -123,24 +123,18 @@ func (p *TransportParameters) unmarshal(r *bytes.Reader, sentBy protocol.Perspec
|
||||||
}
|
}
|
||||||
parameterIDs = append(parameterIDs, paramID)
|
parameterIDs = append(parameterIDs, paramID)
|
||||||
switch paramID {
|
switch paramID {
|
||||||
case ackDelayExponentParameterID:
|
case maxIdleTimeoutParameterID,
|
||||||
if err := p.readNumericTransportParameter(r, paramID, int(paramLen)); err != nil {
|
maxUDPPayloadSizeParameterID,
|
||||||
return err
|
initialMaxDataParameterID,
|
||||||
}
|
initialMaxStreamDataBidiLocalParameterID,
|
||||||
case maxAckDelayParameterID:
|
|
||||||
if err := p.readNumericTransportParameter(r, paramID, int(paramLen)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
case initialMaxStreamDataBidiLocalParameterID,
|
|
||||||
initialMaxStreamDataBidiRemoteParameterID,
|
initialMaxStreamDataBidiRemoteParameterID,
|
||||||
initialMaxStreamDataUniParameterID,
|
initialMaxStreamDataUniParameterID,
|
||||||
initialMaxDataParameterID,
|
|
||||||
initialMaxStreamsBidiParameterID,
|
initialMaxStreamsBidiParameterID,
|
||||||
initialMaxStreamsUniParameterID,
|
initialMaxStreamsUniParameterID,
|
||||||
maxIdleTimeoutParameterID,
|
maxAckDelayParameterID,
|
||||||
maxUDPPayloadSizeParameterID,
|
|
||||||
activeConnectionIDLimitParameterID,
|
activeConnectionIDLimitParameterID,
|
||||||
maxDatagramFrameSizeParameterID:
|
maxDatagramFrameSizeParameterID,
|
||||||
|
ackDelayExponentParameterID:
|
||||||
if err := p.readNumericTransportParameter(r, paramID, int(paramLen)); err != nil {
|
if err := p.readNumericTransportParameter(r, paramID, int(paramLen)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue