forked from premiere/premiere-libtorrent
fixed a checked iterator assert
This commit is contained in:
parent
8ac9b5fea8
commit
3bfaaf1129
|
@ -2142,11 +2142,12 @@ namespace libtorrent
|
||||||
std::vector<char>(m_packet_size).swap(m_recv_buffer);
|
std::vector<char>(m_packet_size).swap(m_recv_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bandwidth_limit[download_channel].quota_left() == 0) break;
|
|
||||||
|
|
||||||
int max_receive = std::min(
|
int max_receive = std::min(
|
||||||
m_bandwidth_limit[download_channel].quota_left()
|
m_bandwidth_limit[download_channel].quota_left()
|
||||||
, m_packet_size - m_recv_pos);
|
, m_packet_size - m_recv_pos);
|
||||||
|
|
||||||
|
if (max_receive == 0) break;
|
||||||
|
|
||||||
asio::error_code ec;
|
asio::error_code ec;
|
||||||
bytes_transferred = m_socket->read_some(asio::buffer(&m_recv_buffer[m_recv_pos]
|
bytes_transferred = m_socket->read_some(asio::buffer(&m_recv_buffer[m_recv_pos]
|
||||||
, max_receive), ec);
|
, max_receive), ec);
|
||||||
|
|
Loading…
Reference in New Issue