()
| 926 | } |
| 927 | |
| 928 | func (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 | |
| 955 | func (pool *BrutePool) doRedirect(bl *baseline.Baseline, depth int) { |
| 956 | if depth >= pool.MaxRedirect { |
no test coverage detected