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
|
@ -6,6 +6,8 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/xtls/xray-core/transport/internet/stat"
|
||||
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/buf"
|
||||
"github.com/xtls/xray-core/common/dice"
|
||||
|
@ -121,7 +123,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
input := link.Reader
|
||||
output := link.Writer
|
||||
|
||||
var conn internet.Connection
|
||||
var conn stat.Connection
|
||||
err := retry.ExponentialBackoff(5, 100).On(func() error {
|
||||
dialDest := destination
|
||||
if h.config.useIP() && dialDest.Address.Family().IsDomain() {
|
||||
|
@ -194,7 +196,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||
|
||||
func NewPacketReader(conn net.Conn, UDPOverride net.Destination) buf.Reader {
|
||||
iConn := conn
|
||||
statConn, ok := iConn.(*internet.StatCouterConnection)
|
||||
statConn, ok := iConn.(*stat.CounterConnection)
|
||||
if ok {
|
||||
iConn = statConn.Connection
|
||||
}
|
||||
|
@ -238,7 +240,7 @@ func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
|||
|
||||
func NewPacketWriter(conn net.Conn, h *Handler, ctx context.Context, UDPOverride net.Destination) buf.Writer {
|
||||
iConn := conn
|
||||
statConn, ok := iConn.(*internet.StatCouterConnection)
|
||||
statConn, ok := iConn.(*stat.CounterConnection)
|
||||
if ok {
|
||||
iConn = statConn.Connection
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue