move the maximum ack delay exponennt to the protocol constants

This commit is contained in:
Marten Seemann
2019-01-28 16:37:00 +09:00
parent cebb4342ec
commit 6834c37462
2 changed files with 5 additions and 2 deletions

View File

@@ -152,8 +152,8 @@ func (p *TransportParameters) readNumericTransportParameter(
}
p.MaxPacketSize = protocol.ByteCount(val)
case ackDelayExponentParameterID:
if val > 20 {
return fmt.Errorf("invalid value for ack_delay_exponent: %d (maximum 20)", val)
if val > protocol.MaxAckDelayExponent {
return fmt.Errorf("invalid value for ack_delay_exponent: %d (maximum %d)", val, protocol.MaxAckDelayExponent)
}
p.AckDelayExponent = uint8(val)
default: