WireGuard proxy: Release packet views after use (#6801)

https://github.com/XTLS/Xray-core/pull/6801#issuecomment-5807228464
This commit is contained in:
Hossin Asaadi
2026-09-24 05:46:26 +00:00
committed by GitHub
parent 7d3e44fee2
commit 60e2a0c502
+2
View File
@@ -136,6 +136,7 @@ func (tun *netTun) Read(buf [][]byte, sizes []int, offset int) (int, error) {
}
n, err := view.Read(buf[0][offset:])
view.Release()
if err != nil {
return 0, err
}
@@ -175,6 +176,7 @@ func (tun *netTun) WriteNotify() {
select {
case tun.incomingPacket <- view:
case <-tun.closed:
view.Release()
}
}