From 4796f6fd677cbee47c8b5703cc47cae19835f680 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 14 Feb 2020 10:19:22 -0800 Subject: [PATCH] cmd/tailscale: document pump(). Signed-off-by: David Anderson --- cmd/tailscale/tailscale.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/tailscale/tailscale.go b/cmd/tailscale/tailscale.go index 3814bde22..5b597a731 100644 --- a/cmd/tailscale/tailscale.go +++ b/cmd/tailscale/tailscale.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // The tailscale command is the Tailscale command-line client. It interacts -// with the tailscaled client daemon. +// with the tailscaled node agent. package main // import "tailscale.com/cmd/tailscale" import ( @@ -25,11 +25,12 @@ import ( "tailscale.com/safesocket" ) -func pump(ctx context.Context, bc *ipn.BackendClient, c net.Conn) { +// pump receives backend messages on conn and pushes them into bc. +func pump(ctx context.Context, bc *ipn.BackendClient, conn net.Conn) { defer log.Printf("Control connection done.\n") - defer c.Close() + defer conn.Close() for ctx.Err() == nil { - msg, err := ipn.ReadMsg(c) + msg, err := ipn.ReadMsg(conn) if err != nil { log.Printf("ReadMsg: %v\n", err) break @@ -43,6 +44,7 @@ func main() { if err != nil { log.Printf("fixConsoleOutput: %v\n", err) } + config := getopt.StringLong("config", 'f', "", "path to config file") server := getopt.StringLong("server", 's', "https://login.tailscale.com", "URL to tailcontrol server") nuroutes := getopt.BoolLong("no-single-routes", 'N', "disallow (non-subnet) routes to single nodes")