XRV should work without rawConn

This commit is contained in:
Eken Chan 2023-06-22 14:43:22 +08:00 committed by yuhan6665
parent 828a632076
commit 6d8fe7315f
3 changed files with 9 additions and 5 deletions

View file

@ -247,7 +247,11 @@ func XtlsRead(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater
} }
} }
} }
if rawConn != nil {
reader = buf.NewReadVReader(conn, rawConn, nil) reader = buf.NewReadVReader(conn, rawConn, nil)
} else {
reader = buf.NewReader(conn)
}
ct = counter ct = counter
newError("XtlsRead readV").WriteToLog(session.ExportIDToError(ctx)) newError("XtlsRead readV").WriteToLog(session.ExportIDToError(ctx))
} }

View file

@ -539,7 +539,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
var err error var err error
if rawConn != nil { if requestAddons.Flow == vless.XRV {
var counter stats.Counter var counter stats.Counter
if statConn != nil { if statConn != nil {
counter = statConn.ReadCounter counter = statConn.ReadCounter
@ -591,7 +591,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
} }
var err error var err error
if rawConn != nil && requestAddons.Flow == vless.XRV { if requestAddons.Flow == vless.XRV {
var counter stats.Counter var counter stats.Counter
if statConn != nil { if statConn != nil {
counter = statConn.WriteCounter counter = statConn.WriteCounter

View file

@ -247,7 +247,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
} }
var err error var err error
if rawConn != nil && requestAddons.Flow == vless.XRV { if requestAddons.Flow == vless.XRV {
if tlsConn, ok := iConn.(*tls.Conn); ok { if tlsConn, ok := iConn.(*tls.Conn); ok {
if tlsConn.ConnectionState().Version != gotls.VersionTLS13 { if tlsConn.ConnectionState().Version != gotls.VersionTLS13 {
return newError(`failed to use `+requestAddons.Flow+`, found outer tls version `, tlsConn.ConnectionState().Version).AtWarning() return newError(`failed to use `+requestAddons.Flow+`, found outer tls version `, tlsConn.ConnectionState().Version).AtWarning()
@ -292,7 +292,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
serverReader = xudp.NewPacketReader(conn) serverReader = xudp.NewPacketReader(conn)
} }
if rawConn != nil { if requestAddons.Flow == vless.XRV {
var counter stats.Counter var counter stats.Counter
if statConn != nil { if statConn != nil {
counter = statConn.ReadCounter counter = statConn.ReadCounter