cap RX buffers in UDP rather than callers

This commit is contained in:
JackDoan
2026-07-31 13:58:52 -05:00
parent d7bcfb5d6b
commit bc70bf47f8
7 changed files with 15 additions and 8 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ func (u *TesterConn) ListenOut(r EncReader, flush func()) error {
case <-u.done:
return os.ErrClosed
case p := <-u.RxPackets:
r(p.From, p.Data)
r(p.From, p.Data[:len(p.Data):len(p.Data)])
// The batcher borrows plaintext decrypted in place inside p.Data
// until Flush, so the packet must stay alive across flush()
flush()