security: use net.JoinHostPort instead of fmt.Sprintf
Some checks failed
Benchmark GC Performance / benchmark (push) Successful in 1m19s
Run Gosec / tests (push) Successful in 48s
Go Revive Lint / lint (push) Successful in 34s
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 31s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 34s
Go Build Multi-Platform / build (arm, freebsd) (push) Failing after 29s
Go Build Multi-Platform / build (arm, linux) (push) Failing after 27s
Go Build Multi-Platform / Create Release (push) Has been skipped
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 48s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m28s
Go Build Multi-Platform / build (amd64, freebsd) (push) Failing after 27s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 27s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 27s
Go Build Multi-Platform / build (arm64, darwin) (push) Failing after 27s
Go Build Multi-Platform / build (arm64, freebsd) (push) Failing after 27s
Performance Monitor / performance-monitor (push) Successful in 2m40s
Go Build Multi-Platform / build (arm64, windows) (push) Failing after 25s
Go Build Multi-Platform / build (arm64, linux) (push) Failing after 27s
Go Test Multi-Platform / Test (macos-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (windows-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (macos-latest, arm64) (push) Has been cancelled
Some checks failed
Benchmark GC Performance / benchmark (push) Successful in 1m19s
Run Gosec / tests (push) Successful in 48s
Go Revive Lint / lint (push) Successful in 34s
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 31s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 34s
Go Build Multi-Platform / build (arm, freebsd) (push) Failing after 29s
Go Build Multi-Platform / build (arm, linux) (push) Failing after 27s
Go Build Multi-Platform / Create Release (push) Has been skipped
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 48s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m28s
Go Build Multi-Platform / build (amd64, freebsd) (push) Failing after 27s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 27s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 27s
Go Build Multi-Platform / build (arm64, darwin) (push) Failing after 27s
Go Build Multi-Platform / build (arm64, freebsd) (push) Failing after 27s
Performance Monitor / performance-monitor (push) Successful in 2m40s
Go Build Multi-Platform / build (arm64, windows) (push) Failing after 25s
Go Build Multi-Platform / build (arm64, linux) (push) Failing after 27s
Go Test Multi-Platform / Test (macos-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (windows-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (macos-latest, arm64) (push) Has been cancelled
This commit is contained in:
@@ -333,7 +333,7 @@ func (tc *TCPClientInterface) reconnect() {
|
|||||||
|
|
||||||
// Log reconnection attempt
|
// Log reconnection attempt
|
||||||
fmt.Printf("Failed to reconnect to %s (attempt %d/%d): %v\n",
|
fmt.Printf("Failed to reconnect to %s (attempt %d/%d): %v\n",
|
||||||
addr, retries+1, tc.maxReconnectTries, err)
|
net.JoinHostPort(tc.targetAddr, fmt.Sprintf("%d", tc.targetPort)), retries+1, tc.maxReconnectTries, err)
|
||||||
|
|
||||||
// Wait with exponential backoff
|
// Wait with exponential backoff
|
||||||
time.Sleep(backoff)
|
time.Sleep(backoff)
|
||||||
@@ -354,7 +354,7 @@ func (tc *TCPClientInterface) reconnect() {
|
|||||||
// If we've exhausted all retries, perform final teardown
|
// If we've exhausted all retries, perform final teardown
|
||||||
tc.teardown()
|
tc.teardown()
|
||||||
fmt.Printf("Failed to reconnect to %s after %d attempts\n",
|
fmt.Printf("Failed to reconnect to %s after %d attempts\n",
|
||||||
fmt.Sprintf("%s:%d", tc.targetAddr, tc.targetPort), tc.maxReconnectTries)
|
net.JoinHostPort(tc.targetAddr, fmt.Sprintf("%d", tc.targetPort)), tc.maxReconnectTries)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tc *TCPClientInterface) Enable() {
|
func (tc *TCPClientInterface) Enable() {
|
||||||
@@ -562,7 +562,7 @@ func (ts *TCPServerInterface) Start() error {
|
|||||||
ts.mutex.Lock()
|
ts.mutex.Lock()
|
||||||
defer ts.mutex.Unlock()
|
defer ts.mutex.Unlock()
|
||||||
|
|
||||||
addr := fmt.Sprintf("%s:%d", ts.bindAddr, ts.bindPort)
|
addr := net.JoinHostPort(ts.bindAddr, fmt.Sprintf("%d", ts.bindPort))
|
||||||
listener, err := net.Listen("tcp", addr)
|
listener, err := net.Listen("tcp", addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to start TCP server: %w", err)
|
return fmt.Errorf("failed to start TCP server: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user