diff options
| author | Simeng He <simeng@tailscale.com> | 2021-07-08 15:44:09 -0400 |
|---|---|---|
| committer | Simeng He <simeng@tailscale.com> | 2021-07-08 15:44:09 -0400 |
| commit | 3b954b15525d33b875c2ab16388ea99e67c40c70 (patch) | |
| tree | e60732a8b01e1a76e9adb6598605e173b0a519e1 | |
| parent | fceffebf163f36c6706190fc5ec88f066b0ac9fa (diff) | |
| download | tailscale-simenghe/admin-ping-test.tar.xz tailscale-simenghe/admin-ping-test.zip | |
normal control is working with hardcoded mapresponsessimenghe/admin-ping-test
Signed-off-by: Simeng He <simeng@tailscale.com>
| -rw-r--r-- | control/controlclient/direct.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 36ca380aa..49d0fb113 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -1325,10 +1325,8 @@ func (c *Direct) CustomPing(mr *tailcfg.MapResponse, ip netaddr.IP) bool { start := time.Now() c.pinger.Ping(ip, true, func(res *ipnstate.PingResult) { fmt.Printf("Callback Nodename : %v, NODEIP : %v, duration : %v\n", res.NodeName, res.NodeIP, res.LatencySeconds) + duration := time.Since(start) + fmt.Printf("Ping operation took %f seconds\n", duration.Seconds()) }) - duration := time.Since(start) - // Send the data to the handler in api.go admin/api/ping - fmt.Printf("Ping operation took %f seconds\n", duration.Seconds()) - - return len(mr.Peers) > 0 + return true } |
