From 1827d19e842c9b2bc7bd647152eef36e55fbcb80 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 5 Apr 2017 14:46:35 -0700 Subject: [PATCH] tun2: more verbosely log pinging --- lib/tun2/server.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/tun2/server.go b/lib/tun2/server.go index 484f5e9..ede8c05 100644 --- a/lib/tun2/server.go +++ b/lib/tun2/server.go @@ -193,6 +193,11 @@ func (c *Connection) Ping() error { } defer stream.Close() + ln.Log(c.F(), ln.F{ + "action": "stream_opened", + "stream_id": stream.(*smux.Stream).ID(), + }) + stream.SetWriteDeadline(time.Now().Add(time.Second)) err = req.Write(stream) if err != nil { @@ -201,6 +206,10 @@ func (c *Connection) Ping() error { return err } + ln.Log(c.F(), ln.F{ + "action": "wrote_request", + }) + stream.SetReadDeadline(time.Now().Add(5 * time.Second)) _, err = stream.Read(make([]byte, 30)) if err != nil {