Skip to content

Commit

Permalink
add blocklist log
Browse files Browse the repository at this point in the history
  • Loading branch information
YouROK committed Sep 26, 2024
1 parent 3d05129 commit f718052
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/torr/utils/blockedIP.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"os"
"path/filepath"
"server/log"
"strings"

"server/settings"
Expand All @@ -16,6 +17,7 @@ func ReadBlockedIP() (ranger iplist.Ranger, err error) {
if err != nil {
return nil, err
}
log.TLogln("Read block list...")
scanner := bufio.NewScanner(strings.NewReader(string(buf)))
var ranges []iplist.Range
for scanner.Scan() {
Expand All @@ -30,6 +32,7 @@ func ReadBlockedIP() (ranger iplist.Ranger, err error) {
err = scanner.Err()
if len(ranges) > 0 {
ranger = iplist.New(ranges)
log.TLogln("Readed ranges:", len(ranges))
}
return
}

0 comments on commit f718052

Please sign in to comment.