Record session uptime (purely for the admin socket)

This commit is contained in:
Neil Alexander 2019-05-29 12:59:36 +01:00
parent b2513fce56
commit 78eb40cbad
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 6 additions and 1 deletions

View file

@ -89,6 +89,7 @@ type Session struct {
BytesSent uint64
BytesRecvd uint64
MTU uint16
Uptime time.Duration
WasMTUFixed bool
}
@ -216,6 +217,7 @@ func (c *Core) GetSessions() []Session {
MTU: sinfo.getMTU(),
BytesSent: sinfo.bytesSent,
BytesRecvd: sinfo.bytesRecvd,
Uptime: time.Now().Sub(sinfo.timeOpened),
WasMTUFixed: sinfo.wasMTUFixed,
}
copy(session.PublicKey[:], sinfo.theirPermPub[:])