@@ -32,7 +32,7 @@ func (r *Rule) Apply(ctx routing.Context) bool {
3232 return r .Condition .Apply (ctx )
3333}
3434
35- func (rr * RoutingRule ) BuildCondition (cachedDMPath string ) (Condition , error ) {
35+ func (rr * RoutingRule ) BuildCondition (domainMatcherPath string ) (Condition , error ) {
3636 conds := NewConditionChan ()
3737
3838 if len (rr .InboundTag ) > 0 {
@@ -113,16 +113,16 @@ func (rr *RoutingRule) BuildCondition(cachedDMPath string) (Condition, error) {
113113 var err error
114114
115115 domains := rr .Domain
116- if runtime .GOOS != "windows" && runtime .GOOS != "wasm" && cachedDMPath == "" {
116+ if runtime .GOOS != "windows" && runtime .GOOS != "wasm" && domainMatcherPath == "" {
117117 var err error
118118 domains , err = GetDomainList (rr .Domain )
119119 if err != nil {
120120 return nil , errors .New ("failed to build domains from mmap" ).Base (err )
121121 }
122122 }
123123
124- if cachedDMPath != "" {
125- matcher , err = GetDomainMathcerWithRuleTag (cachedDMPath , rr .RuleTag )
124+ if domainMatcherPath != "" {
125+ matcher , err = GetDomainMathcerWithRuleTag (domainMatcherPath , rr .RuleTag )
126126 if err != nil {
127127 return nil , errors .New ("failed to build domain condition from cached MphDomainMatcher" ).Base (err )
128128 }
@@ -273,14 +273,14 @@ func GetDomainList(domains []*Domain) ([]*Domain, error) {
273273 return domainList , nil
274274}
275275
276- func GetDomainMathcerWithRuleTag (cachedDMPath string , ruleTag string ) (* DomainMatcher , error ) {
277- bs , err := filesystem .ReadFile (cachedDMPath )
276+ func GetDomainMathcerWithRuleTag (domainMatcherPath string , ruleTag string ) (* DomainMatcher , error ) {
277+ bs , err := filesystem .ReadFile (domainMatcherPath )
278278 if err != nil {
279- return nil , errors .New ("failed to load file: " , cachedDMPath ).Base (err )
279+ return nil , errors .New ("failed to load file: " , domainMatcherPath ).Base (err )
280280 }
281281 g , err := LoadGeoSiteMatcher (bs , ruleTag )
282282 if err != nil {
283- return nil , errors .New ("failed to load file:" , cachedDMPath ).Base (err )
283+ return nil , errors .New ("failed to load file:" , domainMatcherPath ).Base (err )
284284 }
285285 return & DomainMatcher {
286286 Matchers : g ,
0 commit comments