From 302e5d00d03f2f265f44e963a9f9d7fd80bfe294 Mon Sep 17 00:00:00 2001 From: jdl Date: Tue, 16 Jun 2026 07:44:49 +0200 Subject: [PATCH] Audit fixes --- hub/handlers.go | 2 ++ peer/app_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/hub/handlers.go b/hub/handlers.go index 41159a3..20b5391 100644 --- a/hub/handlers.go +++ b/hub/handlers.go @@ -29,6 +29,8 @@ func (a *App) _signin(s *api.Session, w http.ResponseWriter, r *http.Request) er } func (a *App) _signinSubmit(s *api.Session, w http.ResponseWriter, r *http.Request) error { + // Ignoring error here - if host is the empty string, it will contend for the + // lock anyway. host, _, _ := net.SplitHostPort(r.RemoteAddr) if !a.signInLock.TryLock(host) { time.Sleep(time.Second + time.Duration(rand.Int64N(int64(3*time.Second)))) diff --git a/peer/app_test.go b/peer/app_test.go index aae3a9c..42c6ae7 100644 --- a/peer/app_test.go +++ b/peer/app_test.go @@ -26,6 +26,7 @@ func addRelayPeer(t *testing.T, a *App, vpnIP string, ep netip.AddrPort) *Peer { }) p := a.peersByKey[key] p.wgPeer.LastHandshakeTime = time.Now() + p.LastPing = time.Now() return p }