mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(net): stop per-request clients parking connections to remote hosts
The node certificate probe builds a transport for one request and dropped it with the connection still parked, and the remote routing client kept idle connections with no timeout; either stayed open for as long as the remote side wanted. Close the probe's idle connections when it returns, and turn keep-alive off for routing downloads, which are minutes apart. The routing client dials only public hosts, so no loopback test reaches it; TestFetchCertFingerprintLeavesNoIdleConnection covers the probe.
This commit is contained in:
@@ -91,6 +91,7 @@ func (s *NodeService) FetchCertFingerprint(ctx context.Context, n *model.Node) (
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // lgtm[go/disabled-certificate-check]
|
||||
},
|
||||
}
|
||||
defer client.CloseIdleConnections()
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user