Browse Source

- killfile stats: incremented only when adding a new domain in BL

- Malformed lines stats: stats are reset at refresh; ignoring blank/comment lines
master
bloved 1 month ago
parent
commit
5e94032cd0
3 changed files with 21 additions and 2 deletions
  1. +9
    -2
      01.killfile.go
  2. +6
    -0
      adlist_hosts.go
  3. +6
    -0
      adlist_single.go

+ 9
- 2
01.killfile.go View File

@ -26,11 +26,18 @@ func bWriteThread() {
for item := range bChannel {
alreadyInSomeDB := false
for _, config := range item.Kconfigs {
if !alreadyInSomeDB {
alreadyInSomeDB = domainInKillfile(item.Kdomain, config)
}
writeInKillfile(item.Kdomain, item.Ksource, config)
}
incrementStats("BL domains from "+item.Ksource, 1)
incrementStats("TOTAL", 1)
if !alreadyInSomeDB {
incrementStats("BL domains from "+item.Ksource, 1)
incrementStats("TOTAL", 1)
}
}

+ 6
- 0
adlist_hosts.go View File

@ -20,6 +20,9 @@ func DoubleIndexFilter(durl string, configs stringarray) error {
fmt.Println("DoubleIndexFilter: Retrieving HostFile from: ", durl)
// resets malformed HostLines for url
setstatsvalue("Malformed HostLines "+durl, 0)
var err error
// Get the data
@ -48,6 +51,9 @@ func DoubleIndexFilter(durl string, configs stringarray) error {
line := scanner.Text()
if len(line) == 0 || strings.TrimSpace(line)[0] == '#' {
continue
}
h := strings.FieldsFunc(line, splitter)
if h == nil {

+ 6
- 0
adlist_single.go View File

@ -18,6 +18,9 @@ func SingleIndexFilter(durl string, configs stringarray) error {
fmt.Println("Retrieving DomainFile from: ", durl)
// resets malformed HostLines for url
setstatsvalue("Malformed DomainLines "+durl, 0)
var err error
// Get the data
@ -46,6 +49,9 @@ func SingleIndexFilter(durl string, configs stringarray) error {
line := scanner.Text()
if len(line) == 0 || strings.TrimSpace(line)[0] == '#' {
continue
}
h := strings.FieldsFunc(line, splitter)
if h == nil {

Loading…
Cancel
Save