Skip to content

Revert "Take ownership of buffer in QueuePacketConn QueueIncoming/WriteTo"

This reverts commit 839d2218. (Except for the added benchmarks in queuepacketconn_test.go.) This change corresponds to the issues #40187 (closed) and #40199 (closed).

The analysis in #40199 (closed) was wrong; kcp-go does reuse the buffers it passes to QueuePacketConn.WriteTo. This led to unsynchronized reuse of packet buffers and mangled packets observable at the client: #40260 (closed).

Undoing the change in QueuePacketConn.QueueIncoming as well, for symmetry, even though it is not implicated in any correctness problems.

Merge request reports