Skip to content

Commit

Permalink
Use MaxInt32 instead of MaxUInt32 range limit
Browse files Browse the repository at this point in the history
  • Loading branch information
srgoni committed Jun 8, 2018
1 parent 504c3c1 commit 8109380
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions event/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ func (reporter *EventQueue) handleConnect(connected int) {
"connections": reporter.connections,
})
newconn = 0
} else if connected > math.MaxUint32-reporter.connections {
} else if connected > math.MaxInt32-reporter.connections {
reporter.logger.Log(util.Dict{
"event": queueEventError,
"error": queueErrorOverflow,
"message": "Number of connects exceeds counter range, clamping to limit",
"connected": connected,
"connections": reporter.connections,
})
newconn = math.MaxUint32
newconn = math.MaxInt32
} else {
newconn = reporter.connections + connected
}
Expand Down

0 comments on commit 8109380

Please sign in to comment.