MCPcopy Index your code
hub / github.com/tailscale/tailscale / HandleNonKeepAliveMapResponse

Method HandleNonKeepAliveMapResponse

control/controlclient/map.go:235–258  ·  view source on GitHub ↗

HandleNonKeepAliveMapResponse handles a non-KeepAlive MapResponse (full or incremental). All fields that are valid on a KeepAlive MapResponse have already been handled. Debug messages are handled first, followed by pushing the response onto a queue for new updates handled sequentially.

(ctx context.Context, resp *tailcfg.MapResponse)

Source from the content-addressed store, hash-verified

233// Debug messages are handled first, followed by pushing the response onto a
234// queue for new updates handled sequentially.
235func (ms *mapSession) HandleNonKeepAliveMapResponse(ctx context.Context, resp *tailcfg.MapResponse) error {
236 if debug := resp.Debug; debug != nil {
237 if err := ms.onDebug(ctx, debug); err != nil {
238 return err
239 }
240 }
241
242 ms.cqmu.Lock()
243
244 if ms.changeQueueClosed {
245 ms.cqmu.Unlock()
246 ms.processQueue.Wait()
247 return ErrChangeQueueClosed
248 }
249
250 defer ms.cqmu.Unlock()
251
252 change := responseWithSource{
253 response: resp,
254 viaTSMP: false,
255 }
256
257 return ms.addRespToQueue(change)
258}
259
260func (ms *mapSession) addRespToQueue(resp responseWithSource) error {
261 select {

Calls 4

addRespToQueueMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
WaitMethod · 0.65