remove unneeded return value of ReceivedPacketHandler.ReceivedPacket()

This commit is contained in:
Marten Seemann
2019-07-30 12:03:00 +07:00
parent 475ba63164
commit d5585628d8
10 changed files with 78 additions and 147 deletions

View File

@@ -57,16 +57,16 @@ func (h *receivedPacketHandler) ReceivedPacket(
encLevel protocol.EncryptionLevel,
rcvTime time.Time,
shouldInstigateAck bool,
) error {
) {
switch encLevel {
case protocol.EncryptionInitial:
return h.initialPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
h.initialPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
case protocol.EncryptionHandshake:
return h.handshakePackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
h.handshakePackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
case protocol.Encryption1RTT:
return h.oneRTTPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
h.oneRTTPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck)
default:
return fmt.Errorf("received packet with unknown encryption level: %s", encLevel)
panic(fmt.Sprintf("received packet with unknown encryption level: %s", encLevel))
}
}