1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-23 14:09:11 -04:00

move link to transport

This commit is contained in:
Darien Raymond
2018-11-03 12:36:29 +01:00
parent 25e7fa3ade
commit 128a90b98b
24 changed files with 67 additions and 68 deletions

View File

@@ -8,7 +8,7 @@ import (
"time"
"v2ray.com/core/common"
"v2ray.com/core/common/vio"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/pipe"
)
@@ -30,7 +30,7 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
}
// Process implements OutboundHandler.Dispatch().
func (h *Handler) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
nBytes := h.response.WriteTo(link.Writer)
if nBytes > 0 {
// Sleep a little here to make sure the response is sent to client.

View File

@@ -7,8 +7,8 @@ import (
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/serial"
"v2ray.com/core/common/vio"
"v2ray.com/core/proxy/blackhole"
"v2ray.com/core/transport"
"v2ray.com/core/transport/pipe"
)
@@ -28,7 +28,7 @@ func TestBlackholeHTTPResponse(t *testing.T) {
rerr = e
}()
link := vio.Link{
link := transport.Link{
Reader: reader,
Writer: writer,
}

View File

@@ -15,9 +15,9 @@ import (
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/dns"
"v2ray.com/core/features/policy"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -78,7 +78,7 @@ func isValidAddress(addr *net.IPOrDomain) bool {
}
// Process implements proxy.Outbound.
func (h *Handler) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
outbound := session.OutboundFromContext(ctx)
if outbound == nil || !outbound.Target.IsValid() {
return newError("target not specified.")

View File

@@ -9,7 +9,7 @@ import (
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/task"
"v2ray.com/core/common/vio"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -20,7 +20,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
return &Client{}, nil
}
func (c *Client) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
outbound := session.OutboundFromContext(ctx)
if outbound == nil || !outbound.Target.IsValid() {
return newError("unknown destination.")

View File

@@ -10,8 +10,8 @@ import (
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/routing"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -27,7 +27,7 @@ type Inbound interface {
// An Outbound process outbound connections.
type Outbound interface {
// Process processes the given connection. The given dialer may be used to dial a system outbound connection.
Process(context.Context, *vio.Link, internet.Dialer) error
Process(context.Context, *transport.Link, internet.Dialer) error
}
// UserManager is the interface for Inbounds and Outbounds that can manage their users.

View File

@@ -12,8 +12,8 @@ import (
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/policy"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -46,7 +46,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
}
// Process implements OutboundHandler.Process().
func (c *Client) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
outbound := session.OutboundFromContext(ctx)
if outbound == nil || !outbound.Target.IsValid() {
return newError("target not specified")

View File

@@ -13,8 +13,8 @@ import (
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/policy"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -46,7 +46,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
}
// Process implements proxy.Outbound.Process.
func (c *Client) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
outbound := session.OutboundFromContext(ctx)
if outbound == nil || !outbound.Target.IsValid() {
return newError("target not specified.")

View File

@@ -16,10 +16,10 @@ import (
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/policy"
"v2ray.com/core/proxy/vmess"
"v2ray.com/core/proxy/vmess/encoding"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -52,7 +52,7 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
}
// Process implements proxy.Outbound.Process().
func (v *Handler) Process(ctx context.Context, link *vio.Link, dialer internet.Dialer) error {
func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error {
var rec *protocol.ServerSpec
var conn internet.Connection