From 2db76ae78627571ab42bda9421afeec392b19ee8 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 1 Jun 2014 21:56:05 +0200 Subject: [PATCH] Total wire data should always be uint64 (fixes #315) --- model/model.go | 4 ++-- protocol/protocol.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model/model.go b/model/model.go index fc01ba1e2..d274c7ef7 100644 --- a/model/model.go +++ b/model/model.go @@ -186,8 +186,8 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo { res["total"] = ConnectionInfo{ Statistics: protocol.Statistics{ At: time.Now(), - InBytesTotal: int(in), - OutBytesTotal: int(out), + InBytesTotal: in, + OutBytesTotal: out, }, } diff --git a/protocol/protocol.go b/protocol/protocol.go index 4e1ace337..89f1f469d 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -523,15 +523,15 @@ func (c *rawConnection) processRequest(msgID int, req RequestMessage) { type Statistics struct { At time.Time - InBytesTotal int - OutBytesTotal int + InBytesTotal uint64 + OutBytesTotal uint64 } func (c *rawConnection) Statistics() Statistics { return Statistics{ At: time.Now(), - InBytesTotal: int(c.cr.Tot()), - OutBytesTotal: int(c.cw.Tot()), + InBytesTotal: c.cr.Tot(), + OutBytesTotal: c.cw.Tot(), } }