mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-14 04:19:36 +03:00
Fix: CounterConnection with ReadV/WriteV (#720)
Co-authored-by: JimhHan <50871214+JimhHan@users.noreply.github.com>
This commit is contained in:
@ -9,6 +9,8 @@ import (
|
||||
"net/url"
|
||||
"sync"
|
||||
|
||||
"github.com/xtls/xray-core/transport/internet/stat"
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
|
||||
"github.com/xtls/xray-core/common"
|
||||
@ -77,7 +79,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
||||
}
|
||||
|
||||
var user *protocol.MemoryUser
|
||||
var conn internet.Connection
|
||||
var conn stat.Connection
|
||||
|
||||
mbuf, _ := link.Reader.ReadMultiBuffer()
|
||||
len := mbuf.Len()
|
||||
@ -101,7 +103,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
||||
return err
|
||||
}
|
||||
}
|
||||
conn = internet.Connection(netConn)
|
||||
conn = stat.Connection(netConn)
|
||||
}
|
||||
return err
|
||||
}); err != nil {
|
||||
@ -231,7 +233,7 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
|
||||
}
|
||||
|
||||
iConn := rawConn
|
||||
if statConn, ok := iConn.(*internet.StatCouterConnection); ok {
|
||||
if statConn, ok := iConn.(*stat.CounterConnection); ok {
|
||||
iConn = statConn.Connection
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user