mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Fix: CounterConnection with ReadV/WriteV (#720)
Co-authored-by: JimhHan <50871214+JimhHan@users.noreply.github.com>
This commit is contained in:
parent
f2cb13a8ec
commit
24b637cd5e
53 changed files with 247 additions and 128 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue