mapper: consolidate builder and connection helpers

This commit is contained in:
Kristoffer Dalby
2026-06-16 11:33:35 +00:00
parent 03e2d24c79
commit 3979887d8d
4 changed files with 47 additions and 34 deletions
+10
View File
@@ -183,6 +183,16 @@ func (mc *multiChannelNodeConn) removeConnectionByChannel(c chan<- *tailcfg.MapR
return false
}
// detach removes the connection for the given channel and marks the node
// disconnected if no active connections remain.
func (mc *multiChannelNodeConn) detach(c chan<- *tailcfg.MapResponse) {
mc.removeConnectionByChannel(c)
if !mc.hasActiveConnections() {
mc.markDisconnected()
}
}
// hasActiveConnections checks if the node has any active connections.
func (mc *multiChannelNodeConn) hasActiveConnections() bool {
mc.mutex.RLock()