Use runtime.Gosched() instead

This commit is contained in:
RPRX 2020-12-07 16:08:35 +00:00 committed by GitHub
parent bf9401ae7d
commit b3f3c5be81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,8 @@ import (
"context"
"fmt"
"io"
"runtime"
"syscall"
"time"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/errors"
@ -195,7 +195,7 @@ func ReadV(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, c
if conn.SHOW {
fmt.Println(conn.MARK, "Splice")
}
time.Sleep(time.Millisecond) // necessary
runtime.Gosched() // necessary
w, err := tc.ReadFrom(conn.Connection)
if counter != nil {
counter.Add(w)