mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
feat: stream large host scans
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"github.com/shadow1ng/fscan/common"
|
||||
"github.com/shadow1ng/fscan/common/parsers"
|
||||
)
|
||||
|
||||
const maxHostBatchSize = 65536
|
||||
|
||||
func targetHostBatchSize(config *common.Config) int {
|
||||
size := parsers.DefaultHostBatchSize
|
||||
if config != nil && config.ThreadNum > 0 {
|
||||
threadWindow := config.ThreadNum * 8
|
||||
if threadWindow > size {
|
||||
size = threadWindow
|
||||
}
|
||||
}
|
||||
if size > maxHostBatchSize {
|
||||
return maxHostBatchSize
|
||||
}
|
||||
return size
|
||||
}
|
||||
Reference in New Issue
Block a user