tun2: more verbosely log pinging

This commit is contained in:
Cadey Ratio 2017-04-05 14:46:35 -07:00
parent 0ac8f2adbf
commit 1827d19e84
1 changed files with 9 additions and 0 deletions

View File

@ -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 {