forked from premiere/premiere-libtorrent
fixed rate limit bug for DHT
This commit is contained in:
parent
ef48c92a4e
commit
f27e24ba98
|
@ -39,6 +39,7 @@
|
||||||
incoming connection
|
incoming connection
|
||||||
* added more detailed instrumentation of the disk I/O thread
|
* added more detailed instrumentation of the disk I/O thread
|
||||||
|
|
||||||
|
* fixed rate limit bug for DHT
|
||||||
* fixed SOCKS5 bug for routing UDP packets
|
* fixed SOCKS5 bug for routing UDP packets
|
||||||
* fixed bug on windows when verifying resume data for a torrent where
|
* fixed bug on windows when verifying resume data for a torrent where
|
||||||
one of its directories had been removed
|
one of its directories had been removed
|
||||||
|
|
|
@ -772,9 +772,10 @@ void rate_limited_udp_socket::on_tick(error_code const& e)
|
||||||
|
|
||||||
if (m_queue.empty()) return;
|
if (m_queue.empty()) return;
|
||||||
|
|
||||||
while (!m_queue.empty() && int(m_queue.front().buf.size()) >= m_quota)
|
while (!m_queue.empty() && int(m_queue.front().buf.size()) <= m_quota)
|
||||||
{
|
{
|
||||||
queued_packet const& p = m_queue.front();
|
queued_packet const& p = m_queue.front();
|
||||||
|
TORRENT_ASSERT(m_quota >= p.buf.size());
|
||||||
m_quota -= p.buf.size();
|
m_quota -= p.buf.size();
|
||||||
error_code ec;
|
error_code ec;
|
||||||
udp_socket::send(p.ep, &p.buf[0], p.buf.size(), ec);
|
udp_socket::send(p.ep, &p.buf[0], p.buf.size(), ec);
|
||||||
|
|
Loading…
Reference in New Issue