Commit graph

8 commits

Author SHA1 Message Date
fatedier
a88e0e9a49
refactor: clean up code (#5308)
Some checks failed
golangci-lint / lint (push) Has been cancelled
2026-05-12 11:13:50 +08:00
fatedier
f2d1f3739a
pkg/util/xlog: fix AddPrefix not updating existing prefix due to range value copy (#5206)
In AddPrefix, the loop `for _, p := range l.prefixes` creates a copy
of each element. Assignments to p.Value and p.Priority only modify
the local copy, not the original slice element, causing updates to
existing prefixes to be silently lost.

This affects client/service.go where AddPrefix is called with
Name:"runID" on reconnection — the old runID value would persist
in log output instead of being updated to the new one.

Fix by using index-based access `l.prefixes[i]` to modify the
original slice element, and add break since prefix names are unique.
2026-03-06 20:44:40 +08:00
fatedier
610e5ed479
improve yamux logging (#4952) 2025-08-25 17:52:58 +08:00
Gabriel Marin
092e5d3f94
client, pkg, server, test: replaced 'interface{}' with 'any' (#4611) 2025-01-02 11:24:08 +08:00
fatedier
43ba7bd338
use new log package (#4054) 2024-03-12 13:58:53 +08:00
fatedier
3e0c78233a
use std slices package (#4008) 2024-02-20 12:01:41 +08:00
fatedier
d5b41f1e14 sshTunnelGateway refactor (#3784) 2023-11-22 14:35:37 +08:00
fatedier
3fbdea0f6b
rename models to pkg (#2005) 2020-09-23 13:49:14 +08:00