fix potential overflow issue in rate_limited_udp_socket (only if the computer locks up for a long time or you're debugging)

This commit is contained in:
Arvid Norberg 2012-04-04 04:24:29 +00:00
parent 8135a6e3a2
commit 75f110f48e
1 changed files with 1 additions and 1 deletions

View File

@ -1243,7 +1243,7 @@ void rate_limited_udp_socket::on_tick(error_code const& e)
time_duration delta = now - m_last_tick; time_duration delta = now - m_last_tick;
m_last_tick = now; m_last_tick = now;
if (m_quota < m_rate_limit) m_quota += m_rate_limit * total_milliseconds(delta) / 1000; if (m_quota < m_rate_limit) m_quota += boost::uint64_t(m_rate_limit) * total_milliseconds(delta) / 1000;
if (m_queue.empty()) return; if (m_queue.empty()) return;