move cutting of packets at the payload length to the multiplexer

This commit is contained in:
Marten Seemann
2018-07-04 12:46:11 +07:00
parent 90e8d6cbeb
commit a654e7600a
4 changed files with 55 additions and 47 deletions

View File

@@ -412,11 +412,6 @@ func (c *client) handleIETFQUICPacket(p *receivedPacket) error {
default:
return fmt.Errorf("Received unsupported packet type: %s", p.header.Type)
}
if protocol.ByteCount(len(p.data)) < p.header.PayloadLen {
return fmt.Errorf("packet payload (%d bytes) is smaller than the expected payload length (%d bytes)", len(p.data), p.header.PayloadLen)
}
p.data = p.data[:int(p.header.PayloadLen)]
// TODO(#1312): implement parsing of compound packets
}
// this is the first packet we are receiving