diff options
| author | Josh Bleecher Snyder <josh@tailscale.com> | 2021-09-16 16:50:31 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josh@tailscale.com> | 2021-09-17 16:47:00 -0700 |
| commit | c7b75465871eb911df4e1ff91a57b9c91c279111 (patch) | |
| tree | 0b7975a92a5f53ad27ee78525ae4e5660d34c7fe /control/controlclient/direct.go | |
| parent | b14db5d943b84be3c9f3a909c18c9af4012523dd (diff) | |
| download | tailscale-josh/immutable-views.tar.xz tailscale-josh/immutable-views.zip | |
WIP snapshotjosh/immutable-views
Next up: view support for maps, etc.
Diffstat (limited to 'control/controlclient/direct.go')
| -rw-r--r-- | control/controlclient/direct.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 0a7105cb3..4cf47a2ad 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -535,7 +535,7 @@ func inTest() bool { return flag.Lookup("test.v") != nil } // // maxPolls is how many network maps to download; common values are 1 // or -1 (to keep a long-poll query open to the server). -func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*netmap.NetworkMap)) error { +func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(netmap.NetworkMapView)) error { return c.sendMapRequest(ctx, maxPolls, cb) } @@ -552,7 +552,7 @@ func (c *Direct) SendLiteMapUpdate(ctx context.Context) error { const pollTimeout = 120 * time.Second // cb nil means to omit peers. -func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netmap.NetworkMap)) error { +func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(netmap.NetworkMapView)) error { c.mu.Lock() persist := c.persist serverURL := c.serverURL @@ -822,7 +822,7 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm c.expiry = &nm.Expiry c.mu.Unlock() - cb(nm) + cb(nm.View()) } if ctx.Err() != nil { return ctx.Err() |
