Bug fixes for custom filter list

This commit is contained in:
Vladimir Stoilov
2022-07-27 07:47:48 +02:00
committed by Daniel
parent 62c100714a
commit cf30014e9d
3 changed files with 23 additions and 24 deletions

View File

@@ -23,6 +23,12 @@ var (
const numberOfZeroIPsUntilWarning = 100
func parseFile(filePath string) error {
// reset all maps, previous (if any) settings will be lost
countryCodesFilterList = make(map[string]struct{})
ipAddressesFilterList = make(map[string]struct{})
autonomousSystemsFilterList = make(map[uint]struct{})
domainsFilterList = make(map[string]struct{})
// ignore empty file path
if filePath == "" {
return nil
@@ -36,12 +42,6 @@ func parseFile(filePath string) error {
}
defer file.Close()
// initialize maps to hold data from the file
countryCodesFilterList = make(map[string]struct{})
ipAddressesFilterList = make(map[string]struct{})
autonomousSystemsFilterList = make(map[uint]struct{})
domainsFilterList = make(map[string]struct{})
var numberOfZeroIPs uint64
// read filter file line by line