(nodeKeyDst key.NodePublic, msg any)
| 302 | } |
| 303 | |
| 304 | func (s *Server) addDebugMessage(nodeKeyDst key.NodePublic, msg any) bool { |
| 305 | s.mu.Lock() |
| 306 | defer s.mu.Unlock() |
| 307 | node := s.nodeLocked(nodeKeyDst) |
| 308 | if node == nil { |
| 309 | return false |
| 310 | } |
| 311 | updatesCh := s.updates[node.ID] |
| 312 | if updatesCh == nil { |
| 313 | // No streaming poll is registered, so there's nobody to deliver |
| 314 | // the message to. |
| 315 | return false |
| 316 | } |
| 317 | |
| 318 | if _, ok := msg.(*tailcfg.MapResponse); ok { |
| 319 | if s.suppressAutoMapResponses == nil { |
| 320 | s.suppressAutoMapResponses = set.Set[key.NodePublic]{} |
| 321 | } |
| 322 | s.suppressAutoMapResponses.Add(nodeKeyDst) |
| 323 | } |
| 324 | |
| 325 | mak.Set(&s.msgToSend, nodeKeyDst, append(s.msgToSend[nodeKeyDst], msg)) |
| 326 | // sendUpdate returning false here is fine: the channel is a lossy |
| 327 | // wake-up signal whose buffer is single-slot. A full buffer means a |
| 328 | // prior wake-up is still pending, and the streaming poll will check |
| 329 | // msgToSend when it processes that wake-up. The queue in msgToSend |
| 330 | // is the source of truth. |
| 331 | sendUpdate(updatesCh, updateDebugInjection) |
| 332 | return true |
| 333 | } |
| 334 | |
| 335 | // Mark the Node key of every node as expired |
| 336 | func (s *Server) SetExpireAllNodes(expired bool) { |
no test coverage detected