Skip to content

Commit 3167a70

Browse files
committed
Try to fix rare ssl error with freedom splice
1 parent 25c531c commit 3167a70

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

proxy/proxy.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"math/big"
1414
"runtime"
1515
"strconv"
16+
"time"
1617

1718
"github.com/pires/go-proxyproto"
1819
"github.com/xtls/xray-core/common/buf"
@@ -478,6 +479,7 @@ func CopyRawConnIfExist(ctx context.Context, readerConn net.Conn, writerConn net
478479
if inbound.CanSpliceCopy == 1 {
479480
newError("CopyRawConn splice").WriteToLog(session.ExportIDToError(ctx))
480481
runtime.Gosched() // necessary
482+
time.Sleep(time.Millisecond) // without this, there will be a rare ssl error for freedom splice
481483
w, err := tc.ReadFrom(readerConn)
482484
if readCounter != nil {
483485
readCounter.Add(w)

0 commit comments

Comments
 (0)