mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 18:11:27 +00:00
Add back sleep for freedom splice
This commit is contained in:
parent
40e41d8b6b
commit
09656bd5d1
|
@ -13,6 +13,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/pires/go-proxyproto"
|
"github.com/pires/go-proxyproto"
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"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 {
|
for inbound.CanSpliceCopy != 3 {
|
||||||
if inbound.CanSpliceCopy == 1 {
|
if inbound.CanSpliceCopy == 1 {
|
||||||
newError("CopyRawConn splice").WriteToLog(session.ExportIDToError(ctx))
|
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)
|
w, err := tc.ReadFrom(readerConn)
|
||||||
if readCounter != nil {
|
if readCounter != nil {
|
||||||
readCounter.Add(w)
|
readCounter.Add(w)
|
||||||
|
|
Loading…
Reference in a new issue