forked from quic-go/quic-go
simplify content storage in packed packets
It's not necessary to store both the packetBuffer and the slice containing the raw data in the packet.
This commit is contained in:
@@ -218,7 +218,7 @@ func (h *packetHandlerMap) listen() {
|
||||
defer close(h.listening)
|
||||
for {
|
||||
buffer := getPacketBuffer()
|
||||
data := buffer.Slice
|
||||
data := buffer.Data[:protocol.MaxReceivePacketSize]
|
||||
// The packet size should not exceed protocol.MaxReceivePacketSize bytes
|
||||
// If it does, we only read a truncated packet, which will then end up undecryptable
|
||||
n, addr, err := h.conn.ReadFrom(data)
|
||||
|
||||
Reference in New Issue
Block a user