forked from premiere/premiere-libtorrent
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:
parent
8135a6e3a2
commit
75f110f48e
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue