Skip to content

Commit

Permalink
Move duplicatePeerMsg into the function scope
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Parra <[email protected]>
  • Loading branch information
2 people authored and github-actions committed Nov 13, 2024
1 parent f32188c commit 27fbb0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/proxy/peer/internal/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ func VerifyPeerCertificateIsSpecificProxy(peerID string) func(rawCerts [][]byte,
}
}

const duplicatePeerMsg = "Detected multiple Proxy Peers with the same public address when connecting to a Proxy which can lead to inconsistent state and problems establishing sessions. For best results ensure that `peer_public_addr` is unique per proxy and not a load balancer."

// LogDuplicatePeer should be used to log a message if a proxy peering client
// connects to a Proxy that did not have the expected host ID.
func LogDuplicatePeer(ctx context.Context, log *slog.Logger, level slog.Level, args ...any) {
const duplicatePeerMsg = "" +
"Detected multiple Proxy Peers with the same public address when connecting to a Proxy which can lead to inconsistent state and problems establishing sessions. " +
"For best results ensure that `peer_public_addr` is unique per proxy and not a load balancer."
log.Log(ctx, level, duplicatePeerMsg, args...)
}

Expand Down

0 comments on commit 27fbb0b

Please sign in to comment.