fix: harden scan edge cases

This commit is contained in:
ZacharyZcR
2026-06-01 03:32:13 +08:00
parent 8b558b4f12
commit 8ec96bfe6d
21 changed files with 534 additions and 67 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ type SocketIterator struct {
ports []int
hostIdx int
portIdx int
total int
total int64
mu sync.Mutex
}
@@ -51,7 +51,7 @@ func NewSocketIterator(hosts []string, ports []int, exclude map[int]struct{}) *S
return &SocketIterator{
hosts: hosts,
ports: sortedPorts,
total: len(hosts) * len(sortedPorts),
total: int64(len(hosts)) * int64(len(sortedPorts)),
}
}
@@ -113,7 +113,7 @@ func (it *SocketIterator) Next() (string, int, bool) {
}
// Total 返回总任务数(用于进度条)
func (it *SocketIterator) Total() int {
func (it *SocketIterator) Total() int64 {
return it.total
}