mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
update router to adapt to protobuf change
This commit is contained in:
parent
aa17eacc8d
commit
935cf69fb1
@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
// Router is an implementation of routing.Router.
|
// Router is an implementation of routing.Router.
|
||||||
type Router struct {
|
type Router struct {
|
||||||
domainStrategy Config_DomainStrategy
|
domainStrategy DomainStrategy
|
||||||
rules []*Rule
|
rules []*Rule
|
||||||
balancers map[string]*Balancer
|
balancers map[string]*Balancer
|
||||||
dns dns.Client
|
dns dns.Client
|
||||||
@ -86,7 +86,7 @@ func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routing.Context,
|
|||||||
// this prevents cycle resolving dead loop
|
// this prevents cycle resolving dead loop
|
||||||
skipDNSResolve := ctx.GetSkipDNSResolve()
|
skipDNSResolve := ctx.GetSkipDNSResolve()
|
||||||
|
|
||||||
if r.domainStrategy == Config_IpOnDemand && !skipDNSResolve {
|
if r.domainStrategy == DomainStrategy_IpOnDemand && !skipDNSResolve {
|
||||||
ctx = routing_dns.ContextWithDNSClient(ctx, r.dns)
|
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
|
return nil, ctx, common.ErrNoClue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user