mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 20:59:19 +02:00
Use runtime.Gosched() instead
This commit is contained in:
parent
bf9401ae7d
commit
b3f3c5be81
|
@ -8,8 +8,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"github.com/xtls/xray-core/common/buf"
|
||||||
"github.com/xtls/xray-core/common/errors"
|
"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 {
|
if conn.SHOW {
|
||||||
fmt.Println(conn.MARK, "Splice")
|
fmt.Println(conn.MARK, "Splice")
|
||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond) // necessary
|
runtime.Gosched() // necessary
|
||||||
w, err := tc.ReadFrom(conn.Connection)
|
w, err := tc.ReadFrom(conn.Connection)
|
||||||
if counter != nil {
|
if counter != nil {
|
||||||
counter.Add(w)
|
counter.Add(w)
|
||||||
|
|
Loading…
Reference in New Issue