mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-29 11:50:52 +00:00
优化性能, precompare的结果将跳过collect阶段.
优化check failed时的输出, 只有完全不相等才会直接输出, 模糊状态输出移到debug中.
This commit is contained in:
1 parent
a4b8c17748
commit
18d47668cb
1 file changed
+12
-2
+12
-2
@@ -109,8 +109,13 @@ func NewPool(ctx context.Context, config *pkg.Config, outputCh chan *baseline) (
|
||||
if bl.Err != nil {
|
||||
logs.Log.Warnf("[check.error] maybe ip had banned by waf, break (%d/%d), error: %s", pool.failedCount, breakThreshold, bl.Err.Error())
|
||||
pool.failedBaselines = append(pool.failedBaselines, bl)
|
||||
} else if pool.base.Compare(bl) < 1 {
|
||||
logs.Log.Warn("[check.failed] maybe trigger risk control, " + bl.String())
|
||||
} else if i := pool.base.Compare(bl); i < 1 {
|
||||
if i == 0 {
|
||||
logs.Log.Debug("[check.fuzzy] maybe trigger risk control, " + bl.String())
|
||||
} else {
|
||||
logs.Log.Warn("[check.failed] maybe trigger risk control, " + bl.String())
|
||||
}
|
||||
|
||||
pool.failedBaselines = append(pool.failedBaselines, bl)
|
||||
} else {
|
||||
pool.ResetFailed() // 如果后续访问正常, 重置错误次数
|
||||
@@ -252,6 +257,11 @@ func (p *Pool) comparing() {
|
||||
p.outputCh <- bl
|
||||
continue
|
||||
}
|
||||
if !bl.IsValid {
|
||||
// 已经时被precompare过滤的项目, 跳过collect, 直接认为是无效数据
|
||||
p.outputCh <- bl
|
||||
continue
|
||||
}
|
||||
|
||||
bl.Collect()
|
||||
if p.EnableFuzzy && p.base.FuzzyEqual(bl) {
|
||||
|
||||
Reference in new issue
Block a user