Skip to content

Commit ddd9bcc

Browse files
committed
ipn/proxies: avoid logging the entire proxy obj
1 parent 0dc35ce commit ddd9bcc

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

intra/ipn/proxies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func (px *proxifier) ProxyTo(ipp netip.AddrPort, uid string, pids []string) (the
526526

527527
defer func() {
528528
logev(err)("proxy: pin: %s+%s; chosen? %s; stalled? %ds; local: %v; miss: %v; notok: %v; noroute: %v; paused %v; ended %v",
529-
uid, ipp, theone, stalledSec, loproxies, missproxies, notokproxies, norouteproxies, pausedproxies, endproxies)
529+
uid, ipp, idstr(theone), stalledSec, loproxies, missproxies, notokproxies, norouteproxies, pausedproxies, endproxies)
530530
}()
531531

532532
for _, pid := range pids {

intra/ipn/proxy.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"net/netip"
1717
"net/url"
1818
"os"
19+
"slices"
1920
"strconv"
2021
"strings"
2122
"syscall"
@@ -665,12 +666,7 @@ func healthy(p Proxy) error {
665666
}
666667

667668
func has[T comparable](pids []T, pid T) bool {
668-
for _, v := range pids {
669-
if v == pid {
670-
return true
671-
}
672-
}
673-
return false
669+
return slices.Contains(pids, pid)
674670
}
675671

676672
func Same(a, b Proxy) bool {

0 commit comments

Comments
 (0)