mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00
fix: 优化Web超时警告逻辑,消除默认配置的误报
问题: - 每次启动都显示 "Web超时时间大于普通超时时间,可能导致不期望的行为" - 原因:默认配置Web超时(5s) > 普通超时(3s)触发警告 - 但Web超时适当大于普通超时是合理的设计 分析: - 普通超时:用于TCP连接和简单协议探测 - Web超时:用于HTTP请求+响应+内容分析,步骤更复杂 - Web操作理应需要更多时间 修复方案: - 原逻辑:webTimeout > timeout 就警告 - 新逻辑:webTimeout > timeout*2 才警告 - 允许合理的Web超时时间设置 效果验证: - 3s vs 5s (默认):不警告 ✓ - 3s vs 7s (手动设置):仍警告 ✓ - 消除了默认配置的误报警告
This commit is contained in:
parent
31e59c9bee
commit
afdefccfdd
@ -206,8 +206,9 @@ func (np *NetworkParser) parseTimeouts(timeout, webTimeout int64) (time.Duration
|
|||||||
finalWebTimeout = time.Duration(webTimeout) * time.Second
|
finalWebTimeout = time.Duration(webTimeout) * time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证超时配置合理性
|
// 验证超时配置合理性:只有在Web超时显著大于普通超时时才警告
|
||||||
if finalWebTimeout > finalTimeout {
|
// Web超时适当大于普通超时是合理的,因为Web请求包含更多步骤
|
||||||
|
if finalWebTimeout > finalTimeout*2 {
|
||||||
warnings = append(warnings, i18n.GetText("config_web_timeout_warning"))
|
warnings = append(warnings, i18n.GetText("config_web_timeout_warning"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user