MCPcopy Create free account
hub / github.com/chainreactors/spray / doCheck

Method doCheck

core/pool/brutepool.go:928–953  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

926}
927
928func (pool *BrutePool) doCheck() {
929 if pool.failedCount > pool.BreakThreshold {
930 // 当报错次数超过上限是, 结束任务
931 if pool.isFallback.Load() {
932 return
933 }
934 pool.isFallback.Store(true)
935 pool.fallback()
936 pool.IsFailed = true
937 pool.Cancel()
938 return
939 }
940
941 var unit *Unit
942 wordOffset := int(pool.wordOffset.Load())
943 if pool.Mod == HostSpray {
944 pool.Statistor.CheckNumber++
945 unit = &Unit{host: pkg.RandHost(), source: parsers.CheckSource, number: wordOffset}
946 } else if pool.Mod == PathSpray {
947 pool.Statistor.CheckNumber++
948 unit = &Unit{path: pool.safePath(pkg.RandPath()), source: parsers.CheckSource, number: wordOffset}
949 } else {
950 return
951 }
952 pool.addAddition(unit)
953}
954
955func (pool *BrutePool) doRedirect(bl *baseline.Baseline, depth int) {
956 if depth >= pool.MaxRedirect {

Callers 1

maybeScheduleCheckMethod · 0.95

Calls 5

fallbackMethod · 0.95
safePathMethod · 0.95
RandHostFunction · 0.92
RandPathFunction · 0.92
addAdditionMethod · 0.80

Tested by

no test coverage detected