This commit is contained in:
风扇滑翔翼
2025-12-22 05:13:52 +00:00
committed by GitHub
parent 42214c3287
commit c6a76ff281
+4 -5
View File
@@ -5,9 +5,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/xtls/xray-core/features/policy"
"github.com/xtls/xray-core/common/errors" "github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/signal" "github.com/xtls/xray-core/common/signal"
"github.com/xtls/xray-core/features/policy"
"github.com/xtls/xray-core/features/stats" "github.com/xtls/xray-core/features/stats"
) )
@@ -147,7 +147,7 @@ func copyV(r *SingleReader, w Writer, handler *copyHandler) error {
// 0 in ARM MIPS MIPSLE // 0 in ARM MIPS MIPSLE
// 4kb in ARM64 MIPS64 MIPS64LE // 4kb in ARM64 MIPS64 MIPS64LE
// 512kb in others // 512kb in others
channelBuffer := (policy.SessionDefault().Buffer.PerConnection)/Size channelBuffer := (policy.SessionDefault().Buffer.PerConnection) / Size
if channelBuffer <= 0 { if channelBuffer <= 0 {
channelBuffer = 4 channelBuffer = 4
} }
@@ -217,9 +217,8 @@ func copyV(r *SingleReader, w Writer, handler *copyHandler) error {
} }
}() }()
wg.Wait() wg.Wait()
for range cache { // drain cache
// drain cache for b := range cache {
b := <-cache
b.Release() b.Release()
} }
if wErr != nil { if wErr != nil {