{"record":{"id":"e52ce42a27874667","repo":"shadow1ng/fscan","slug":"network-rate-limited","errorCode":"network_rate_limited","errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/network.go","lineNumber":128,"sourceCode":"\t}\n\n\t// 无代理配置，使用直连\n\tconfig.Type = proxy.ProxyTypeNone\n\treturn config\n}\n\n// =============================================================================\n// TCP 连接\n// =============================================================================\n\n// Deprecated: WrapperTcpWithTimeout 仅供 libs/grdp 兼容使用，新代码请用 ScanSession.DialTCP\n//\n//nolint:revive\nfunc WrapperTcpWithTimeout(network, address string, timeout time.Duration) (net.Conn, error) {\n\t// 检查发包限制 - 在代理连接前进行控制\n\tif canSend, reason := CanSendPacket(); !canSend {\n\t\tLogError(i18n.Tr(\"tcp_connection_restricted\", address, reason))\n\t\treturn nil, fmt.Errorf(\"%s\", i18n.Tr(\"network_rate_limited\", reason))\n\t}\n\n\t// 获取全局拨号器（复用，避免重复创建）\n\tdialer, err := getGlobalDialer(timeout)\n\tif err != nil {\n\t\tLogError(i18n.Tr(\"proxy_dialer_failed\", err))\n\t\tGetGlobalState().IncrementTCPFailedPacketCount()\n\t\treturn nil, err\n\t}\n\n\t// 使用代理拨号器连接\n\tconn, err := dialer.DialContext(context.Background(), network, address)\n\n\t// 统计TCP包数量 - 无论是否使用代理都要计数\n\tif err != nil {\n\t\tGetGlobalState().IncrementTCPFailedPacketCount()\n\t\tLogDebug(i18n.Tr(\"connection_failed\", address, err))\n\t\treturn nil, err","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/network.go#L110-L146","documentation":"Deprecated WrapperTcpWithTimeout helper (used by libs/grdp) rejects the dial because CanSendPacket() reported the global packet limiter (count or rate cap) blocks a new connection to this address; the localized message carries the address and reason.","triggerScenarios":"Thrown at common/network.go:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise or disable the packet limit flags if the traffic is expected","Reduce concurrent connections to stay under the rate cap","Postpone and retry the dial once the limiter window resets"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}