mirror of
				https://github.com/chainreactors/spray.git
				synced 2025-11-04 09:58:03 +00:00 
			
		
		
		
	优化性能, precompare的结果将跳过collect阶段.
优化check failed时的输出, 只有完全不相等才会直接输出, 模糊状态输出移到debug中.
This commit is contained in:
		
							parent
							
								
									c94a4c4d10
								
							
						
					
					
						commit
						2fe0466ab0
					
				@ -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) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user