From 09656bd5d1a52d8aed119bcd75a2ffea238a4672 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Thu, 15 Feb 2024 21:14:42 -0500 Subject: [PATCH] Add back sleep for freedom splice --- proxy/proxy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 4dcb6bf9..e8adb7e2 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -13,6 +13,7 @@ import ( "math/big" "runtime" "strconv" + "time" "github.com/pires/go-proxyproto" "github.com/xtls/xray-core/common/buf" @@ -477,7 +478,8 @@ func CopyRawConnIfExist(ctx context.Context, readerConn net.Conn, writerConn net for inbound.CanSpliceCopy != 3 { if inbound.CanSpliceCopy == 1 { newError("CopyRawConn splice").WriteToLog(session.ExportIDToError(ctx)) - runtime.Gosched() // necessary + //runtime.Gosched() // necessary + time.Sleep(time.Millisecond) // without this, there will be a rare ssl error for freedom splice w, err := tc.ReadFrom(readerConn) if readCounter != nil { readCounter.Add(w)