1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 14:06:58 -05:00

update router to adapt to protobuf change

This commit is contained in:
Shelikhoo 2021-09-07 08:01:40 +01:00
parent aa17eacc8d
commit 935cf69fb1
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -15,7 +15,7 @@ import (
// Router is an implementation of routing.Router.
type Router struct {
domainStrategy Config_DomainStrategy
domainStrategy DomainStrategy
rules []*Rule
balancers map[string]*Balancer
dns dns.Client
@ -86,7 +86,7 @@ func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routing.Context,
// this prevents cycle resolving dead loop
skipDNSResolve := ctx.GetSkipDNSResolve()
if r.domainStrategy == Config_IpOnDemand && !skipDNSResolve {
if r.domainStrategy == DomainStrategy_IpOnDemand && !skipDNSResolve {
ctx = routing_dns.ContextWithDNSClient(ctx, r.dns)
}
@ -96,7 +96,7 @@ func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routing.Context,
}
}
if r.domainStrategy != Config_IpIfNonMatch || len(ctx.GetTargetDomain()) == 0 || skipDNSResolve {
if r.domainStrategy != DomainStrategy_IpIfNonMatch || len(ctx.GetTargetDomain()) == 0 || skipDNSResolve {
return nil, ctx, common.ErrNoClue
}