From f894fad4f7e162ef949edb48c2c79865b93a11e1 Mon Sep 17 00:00:00 2001 From: Simeng He Date: Mon, 10 May 2021 12:24:07 -0400 Subject: [PATCH] Small log additions for my own sake --- control/controlclient/auto.go | 2 ++ control/controlclient/direct.go | 4 +++- tailcfg/tailcfg.go | 9 ++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/control/controlclient/auto.go b/control/controlclient/auto.go index fd1823fa9..145466e04 100644 --- a/control/controlclient/auto.go +++ b/control/controlclient/auto.go @@ -7,6 +7,7 @@ import ( "context" "fmt" + "log" "sync" "time" @@ -157,6 +158,7 @@ func (c *Auto) Start() { // // It should be called whenever there's something new to tell the server. func (c *Auto) sendNewMapRequest() { + log.Println("sendNewMapRequest breakpoint") c.mu.Lock() // If we're not already streaming a netmap, or if we're already stuck diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 34f27f8e1..757b43923 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -553,6 +553,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 { + log.Println("POLLNETMAP BREAKPOINT") return c.sendMapRequest(ctx, maxPolls, cb) } @@ -560,6 +561,7 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*netmap.N // but does not fetch anything. It returns an error if the server did not return a // successful 200 OK response. func (c *Direct) SendLiteMapUpdate(ctx context.Context) error { + log.Println("SendLiteMapUpdate BREAKPOINT") return c.sendMapRequest(ctx, 1, nil) } @@ -571,7 +573,7 @@ func (c *Direct) SendLiteMapUpdate(ctx context.Context) error { // cb nil means to omit peers. func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netmap.NetworkMap)) error { c.mu.Lock() - log.Println("Sending a map request") + log.Println("sendMapRequest ENDPOINT") persist := c.persist serverURL := c.serverURL serverKey := c.serverKey diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 5a464aca2..e846ac04c 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -749,11 +749,6 @@ type MapRequest struct { // * "minimize-netmap": have control minimize the netmap, removing // peers that are unreachable per ACLS. DebugFlags []string `json:",omitempty"` - - // According to https://roamresearch.com/#/app/ts-corp/page/4Bn_Famn2 - // Client can stream responses back. - // We will add a struct with the proper fields - PingResult *StreamedPingResult `json:",omitempty"` } // PortRange represents a range of UDP or TCP port numbers. @@ -897,6 +892,10 @@ type PingRequest struct { MaxPings int // MaxPings total, direct or DERPed PayloadSize int // default: 0 extra bytes } + +// According to https://roamresearch.com/#/app/ts-corp/page/4Bn_Famn2 +// Client can stream responses back. +// We will add a struct with the proper fields type StreamedPingResult struct { IP netaddr.IP SeqNum int // somewhat redundant with TxID but for clarity