|
@@ -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
|
|
|
}
|
|
}
|
|
|
|
|
|