MCPcopy Create free account
hub / github.com/coder/wush / handleEndpointUpdate

Method handleEndpointUpdate

tsserver/server.go:621–639  ·  view source on GitHub ↗
(_ http.ResponseWriter, req *tailcfg.MapRequest)

Source from the content-addressed store, hash-verified

619}
620
621func (ns *noiseServer) handleEndpointUpdate(_ http.ResponseWriter, req *tailcfg.MapRequest) {
622 node := ns.getSelfNode()
623
624 change := peerChange(req, node)
625 change.Online = ptr.To(true)
626 applyPeerChange(node, change)
627
628 _ = ns.storeNode(node)
629
630 sendUpdate, routesChanged := hostInfoChanged(node.Hostinfo.AsStruct(), req.Hostinfo)
631 node.Hostinfo = req.Hostinfo.View()
632 _ = routesChanged
633
634 if peerChangeEmpty(change) && !sendUpdate {
635 return
636 }
637
638 ns.notifyUpdate()
639}
640
641func applyPeerChange(node *tailcfg.Node, change tailcfg.PeerChange) {
642 if change.Key != nil {

Callers 1

Calls 7

getSelfNodeMethod · 0.95
storeNodeMethod · 0.95
notifyUpdateMethod · 0.95
peerChangeFunction · 0.85
applyPeerChangeFunction · 0.85
hostInfoChangedFunction · 0.85
peerChangeEmptyFunction · 0.85

Tested by

no test coverage detected