refactor: 清除 core/plugins 全局状态依赖,ProgressManager 缓存引用 (Phase 5)
测试构建 / 代码检查 (push) Has been cancelled
测试构建 / 单元测试和构建 (push) Has been cancelled
测试构建 / 构建验证 (push) Has been cancelled

- core/alive_scanner.go: GetFlagVars() → session.Params
- core/service_scanner.go: GetFlagVars() → session.Params 和 config.Target.Ports
- common/progress_manager.go: 缓存 State 和 NoColor 到字段,不再运行时读全局
- common/output_api.go: SaveResult 改用 GetGlobalConfig().Output.DisableSave
- common/network.go: WrapperTcpWithTimeout 标记 Deprecated
- core/ 和 plugins/ 下已无全局状态调用残留
This commit is contained in:
ZacharyZcR
2026-04-27 23:31:56 +08:00
parent c98805e85a
commit 91a9a1a11b
5 changed files with 23 additions and 18 deletions
+2 -4
View File
@@ -102,11 +102,9 @@ func createProxyConfig(timeout time.Duration) *proxy.ProxyConfig {
// TCP 连接
// =============================================================================
// WrapperTcpWithTimeout TCP连接包装器,带超时
// 支持通过代理管理器进行SOCKS5和HTTP代理连接,并集成发包控制
// 使用全局拨号器复用连接,避免重复创建代理握手开销
// Deprecated: WrapperTcpWithTimeout 仅供 mylib/grdp 兼容使用,新代码请用 ScanSession.DialTCP
//
//nolint:revive // 保持向后兼容性,避免破坏大量现有代码
//nolint:revive
func WrapperTcpWithTimeout(network, address string, timeout time.Duration) (net.Conn, error) {
// 检查发包限制 - 在代理连接前进行控制
if canSend, reason := CanSendPacket(); !canSend {