From 3167a70ff8f0ac7e2b6c4f8ffc57a0a2ada0be9c Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Fri, 26 Jan 2024 02:14:26 -0500 Subject: [PATCH] Try to fix rare ssl error with freedom splice --- proxy/proxy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/proxy.go b/proxy/proxy.go index 4dcb6bf9..ee131315 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" @@ -478,6 +479,7 @@ func CopyRawConnIfExist(ctx context.Context, readerConn net.Conn, writerConn net if inbound.CanSpliceCopy == 1 { newError("CopyRawConn splice").WriteToLog(session.ExportIDToError(ctx)) 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)