@@ -19,6 +19,7 @@ import (
1919 "github.com/xtls/xray-core/core"
2020 "github.com/xtls/xray-core/features/policy"
2121 "github.com/xtls/xray-core/features/routing"
22+ "github.com/xtls/xray-core/proxy"
2223 "github.com/xtls/xray-core/proxy/http"
2324 "github.com/xtls/xray-core/transport/internet/stat"
2425 "github.com/xtls/xray-core/transport/internet/udp"
@@ -75,6 +76,9 @@ func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Con
7576 inbound .User = & protocol.MemoryUser {
7677 Level : s .config .UserLevel ,
7778 }
79+ if ! proxy .IsRAWTransport (conn ) {
80+ inbound .CanSpliceCopy = 3
81+ }
7882
7983 switch network {
8084 case net .Network_TCP :
@@ -199,7 +203,9 @@ func (s *Server) transport(ctx context.Context, reader io.Reader, writer io.Writ
199203 }
200204
201205 responseDone := func () error {
202- inbound .CanSpliceCopy = 1
206+ if inbound .CanSpliceCopy == 2 {
207+ inbound .CanSpliceCopy = 1
208+ }
203209 defer timer .SetTimeout (plcy .Timeouts .UplinkOnly )
204210
205211 v2writer := buf .NewWriter (writer )
@@ -259,7 +265,9 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn stat.Connection, dis
259265 if inbound != nil && inbound .Source .IsValid () {
260266 errors .LogInfo (ctx , "client UDP connection from " , inbound .Source )
261267 }
262- inbound .CanSpliceCopy = 1
268+ if inbound .CanSpliceCopy == 2 {
269+ inbound .CanSpliceCopy = 1
270+ }
263271
264272 var dest * net.Destination
265273
0 commit comments