1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-02 23:35:40 -05: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

@@ -9,9 +9,9 @@ import (
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/vio"
"v2ray.com/core/features/outbound"
"v2ray.com/core/proxy"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/pipe"
)
@@ -96,7 +96,7 @@ func (h *Handler) Tag() string {
}
// Dispatch implements proxy.Outbound.Dispatch.
func (h *Handler) Dispatch(ctx context.Context, link *vio.Link) {
func (h *Handler) Dispatch(ctx context.Context, link *transport.Link) {
if h.mux != nil {
if err := h.mux.Dispatch(ctx, link); err != nil {
newError("failed to process mux outbound traffic").Base(err).WriteToLog(session.ExportIDToError(ctx))
@@ -130,7 +130,7 @@ func (h *Handler) Dial(ctx context.Context, dest net.Destination) (internet.Conn
uplinkReader, uplinkWriter := pipe.New(opts...)
downlinkReader, downlinkWriter := pipe.New(opts...)
go handler.Dispatch(ctx, &vio.Link{Reader: uplinkReader, Writer: downlinkWriter})
go handler.Dispatch(ctx, &transport.Link{Reader: uplinkReader, Writer: downlinkWriter})
return net.NewConnection(net.ConnectionInputMulti(uplinkWriter), net.ConnectionOutputMulti(downlinkReader)), nil
}