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)
| 233 | // Debug messages are handled first, followed by pushing the response onto a |
| 234 | // queue for new updates handled sequentially. |
| 235 | func (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 | |
| 260 | func (ms *mapSession) addRespToQueue(resp responseWithSource) error { |
| 261 | select { |