Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vigilans committed Aug 31, 2020
1 parent 9e0859e commit 47c997d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/dns/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ func (s *Server) IsOwnLink(ctx context.Context) bool {

// Match check dns ip match geoip
func (s *Server) Match(idx int, client Client, domain string, ips []net.IP) ([]net.IP, error) {
matcher := s.ipIndexMap[idx]
var matcher *MultiGeoIPMatcher
if idx < len(s.ipIndexMap) {
matcher = s.ipIndexMap[idx]
}
if matcher == nil {
return ips, nil
}
Expand Down
2 changes: 1 addition & 1 deletion common/strmatcher/strmatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (t Type) New(pattern string) (Matcher, error) {

// IndexMatcher is the interface for matching with a group of matchers.
type IndexMatcher interface {
// Match returns the the index of a matcher that matches the input. It returns 0 if no such matcher exists.
// Match returns the the index of a matcher that matches the input. It returns empty array if no such matcher exists.
Match(input string) []uint32
}

Expand Down

0 comments on commit 47c997d

Please sign in to comment.