Browse Source

Use runtime.Gosched() instead

RPRX 4 năm trước cách đây
mục cha
commit
b3f3c5be81
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      proxy/vless/encoding/encoding.go

+ 2 - 2
proxy/vless/encoding/encoding.go

@@ -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)