mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
Chore: fix lint according to golangci-lint errors (#781)
* Chore: fix lint according to golangci-lint errors * Chore: regenerate pb.go files
This commit is contained in:
parent
88e1e25aa9
commit
e46204f828
@ -305,19 +305,17 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
|
|||||||
common.Interrupt(link.Reader)
|
common.Interrupt(link.Reader)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else if d.router != nil {
|
||||||
if d.router != nil {
|
if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
|
||||||
if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
|
tag := route.GetOutboundTag()
|
||||||
tag := route.GetOutboundTag()
|
if h := d.ohm.GetHandler(tag); h != nil {
|
||||||
if h := d.ohm.GetHandler(tag); h != nil {
|
newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
|
||||||
newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
|
handler = h
|
||||||
handler = h
|
|
||||||
} else {
|
|
||||||
newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
|
||||||
}
|
|
||||||
} else {
|
} 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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"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/mux"
|
||||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||||
|
@ -86,7 +86,6 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
|
|||||||
}
|
}
|
||||||
conds.Add(matcher)
|
conds.Add(matcher)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(rr.UserEmail) > 0 {
|
if len(rr.UserEmail) > 0 {
|
||||||
|
@ -135,11 +135,11 @@ type DialingWorkerFactory struct {
|
|||||||
ctx context.Context
|
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{
|
return &DialingWorkerFactory{
|
||||||
Proxy: Proxy,
|
Proxy: proxy,
|
||||||
Dialer: Dialer,
|
Dialer: dialer,
|
||||||
Strategy: Strategy,
|
Strategy: strategy,
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"strings"
|
"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"
|
||||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
core "github.com/v2fly/v2ray-core/v4"
|
core "github.com/v2fly/v2ray-core/v4"
|
||||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
_ "github.com/v2fly/v2ray-core/v4/app/router"
|
_ "github.com/v2fly/v2ray-core/v4/app/router"
|
||||||
_ "github.com/v2fly/v2ray-core/v4/app/stats"
|
_ "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"
|
_ "github.com/v2fly/v2ray-core/v4/transport/internet/tagged/taggedimpl"
|
||||||
|
|
||||||
// Inbound and outbound proxies.
|
// Inbound and outbound proxies.
|
||||||
|
@ -198,9 +198,8 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
|||||||
}
|
}
|
||||||
if s.isAEADForced {
|
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."))
|
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
|
user = userLegacy
|
||||||
iv := hashTimestamp(md5.New(), timestamp)
|
iv := hashTimestamp(md5.New(), timestamp)
|
||||||
vmessAccount = userLegacy.Account.(*vmess.MemoryAccount)
|
vmessAccount = userLegacy.Account.(*vmess.MemoryAccount)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.25.0
|
// protoc-gen-go v1.25.0
|
||||||
// protoc v3.13.0
|
// protoc v3.15.5
|
||||||
// source: transport/internet/grpc/config.proto
|
// source: transport/internet/grpc/config.proto
|
||||||
|
|
||||||
package grpc
|
package grpc
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.25.0
|
// protoc-gen-go v1.25.0
|
||||||
// protoc v3.13.0
|
// protoc v3.15.5
|
||||||
// source: transport/internet/grpc/encoding/stream.proto
|
// source: transport/internet/grpc/encoding/stream.proto
|
||||||
|
|
||||||
package encoding
|
package encoding
|
||||||
|
Loading…
Reference in New Issue
Block a user