1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 18:00:43 +00:00

Merge branch 'master' into v5

This commit is contained in:
loyalsoldier 2020-12-19 13:03:10 +08:00
commit ebb12b7e12
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90

View File

@ -62,6 +62,10 @@ func New(ctx context.Context, config *Config) (*DNS, error) {
for _, ns := range config.NameServer {
domainRuleCount += len(ns.PrioritizedDomain)
}
// Fixes https://github.com/v2fly/v2ray-core/issues/529
// Compatible with `localhost` nameserver specified in config file
domainRuleCount += len(localTLDsAndDotlessDomains)
// MatcherInfos is ensured to cover the maximum index domainMatcher could return, where matcher's index starts from 1
matcherInfos := make([]DomainMatcherInfo, domainRuleCount+1)
domainMatcher := &strmatcher.MatcherGroup{}