diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 45f9f5cb0..53c5774ed 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -305,19 +305,17 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport. common.Interrupt(link.Reader) return } - } else { - if d.router != nil { - if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil { - tag := route.GetOutboundTag() - if h := d.ohm.GetHandler(tag); h != nil { - newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx)) - handler = h - } else { - newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx)) - } + } else if d.router != nil { + if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil { + tag := route.GetOutboundTag() + if h := d.ohm.GetHandler(tag); h != nil { + newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx)) + handler = h } else { - newError("default route for ", destination).WriteToLog(session.ExportIDToError(ctx)) + newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx)) } + } else { + newError("default route for ", destination).WriteToLog(session.ExportIDToError(ctx)) } } diff --git a/app/reverse/bridge.go b/app/reverse/bridge.go index 1755ed3d2..8dde5b1dd 100644 --- a/app/reverse/bridge.go +++ b/app/reverse/bridge.go @@ -6,7 +6,7 @@ import ( "context" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/v2fly/v2ray-core/v4/common/mux" "github.com/v2fly/v2ray-core/v4/common/net" diff --git a/app/router/config.go b/app/router/config.go index 07931711f..52699fcfd 100644 --- a/app/router/config.go +++ b/app/router/config.go @@ -86,7 +86,6 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) { } conds.Add(matcher) } - } if len(rr.UserEmail) > 0 { diff --git a/common/mux/client.go b/common/mux/client.go index f83b27dbc..714ba6de1 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -135,11 +135,11 @@ type DialingWorkerFactory struct { ctx context.Context } -func NewDialingWorkerFactory(ctx context.Context, Proxy proxy.Outbound, Dialer internet.Dialer, Strategy ClientStrategy) *DialingWorkerFactory { +func NewDialingWorkerFactory(ctx context.Context, proxy proxy.Outbound, dialer internet.Dialer, strategy ClientStrategy) *DialingWorkerFactory { return &DialingWorkerFactory{ - Proxy: Proxy, - Dialer: Dialer, - Strategy: Strategy, + Proxy: proxy, + Dialer: dialer, + Strategy: strategy, ctx: ctx, } } diff --git a/config.go b/config.go index ae5b6aee7..50e27e946 100644 --- a/config.go +++ b/config.go @@ -6,7 +6,7 @@ import ( "io" "strings" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/v2fly/v2ray-core/v4/common" "github.com/v2fly/v2ray-core/v4/common/buf" diff --git a/functions_test.go b/functions_test.go index 719c4f6a3..7a3d3476d 100644 --- a/functions_test.go +++ b/functions_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" + "google.golang.org/protobuf/proto" core "github.com/v2fly/v2ray-core/v4" "github.com/v2fly/v2ray-core/v4/app/dispatcher" diff --git a/main/distro/all/all.go b/main/distro/all/all.go index 5f069e341..8e1528404 100644 --- a/main/distro/all/all.go +++ b/main/distro/all/all.go @@ -23,6 +23,7 @@ import ( _ "github.com/v2fly/v2ray-core/v4/app/router" _ "github.com/v2fly/v2ray-core/v4/app/stats" + // Fix dependency cycle caused by core import in internet package _ "github.com/v2fly/v2ray-core/v4/transport/internet/tagged/taggedimpl" // Inbound and outbound proxies. diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index 929ae8d53..02dae2635 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -198,9 +198,8 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request } if s.isAEADForced { return nil, drainConnection(newError("invalid user: VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this security feature with environment variable v2ray.vmess.aead.forced = false . You will not be able to enable legacy header workaround in the future.")) - } else { - newError("Critical Warning: potentially invalid user: a non VMessAEAD connection is received. From 2022 Jan 1st, this kind of connection will be rejected by default. You should update or replace your client software now. ").AtWarning().WriteToLog() } + newError("Critical Warning: potentially invalid user: a non VMessAEAD connection is received. From 2022 Jan 1st, this kind of connection will be rejected by default. You should update or replace your client software now. ").AtWarning().WriteToLog() user = userLegacy iv := hashTimestamp(md5.New(), timestamp) vmessAccount = userLegacy.Account.(*vmess.MemoryAccount) diff --git a/transport/internet/grpc/config.pb.go b/transport/internet/grpc/config.pb.go index 51c2b15e0..14bb4f284 100644 --- a/transport/internet/grpc/config.pb.go +++ b/transport/internet/grpc/config.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.13.0 +// protoc v3.15.5 // source: transport/internet/grpc/config.proto package grpc diff --git a/transport/internet/grpc/encoding/stream.pb.go b/transport/internet/grpc/encoding/stream.pb.go index 08b2f4967..0474bb6b8 100644 --- a/transport/internet/grpc/encoding/stream.pb.go +++ b/transport/internet/grpc/encoding/stream.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.13.0 +// protoc v3.15.5 // source: transport/internet/grpc/encoding/stream.proto package encoding