Total wire data should always be uint64 (fixes #315)

This commit is contained in:
Jakob Borg 2014-06-01 21:56:05 +02:00
parent a0b15d006d
commit 2db76ae786
2 changed files with 6 additions and 6 deletions

View File

@ -186,8 +186,8 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
res["total"] = ConnectionInfo{ res["total"] = ConnectionInfo{
Statistics: protocol.Statistics{ Statistics: protocol.Statistics{
At: time.Now(), At: time.Now(),
InBytesTotal: int(in), InBytesTotal: in,
OutBytesTotal: int(out), OutBytesTotal: out,
}, },
} }

View File

@ -523,15 +523,15 @@ func (c *rawConnection) processRequest(msgID int, req RequestMessage) {
type Statistics struct { type Statistics struct {
At time.Time At time.Time
InBytesTotal int InBytesTotal uint64
OutBytesTotal int OutBytesTotal uint64
} }
func (c *rawConnection) Statistics() Statistics { func (c *rawConnection) Statistics() Statistics {
return Statistics{ return Statistics{
At: time.Now(), At: time.Now(),
InBytesTotal: int(c.cr.Tot()), InBytesTotal: c.cr.Tot(),
OutBytesTotal: int(c.cw.Tot()), OutBytesTotal: c.cw.Tot(),
} }
} }