fix bug in peer_connection::second_tick

This commit is contained in:
Arvid Norberg 2014-09-20 23:57:59 +00:00
parent 645d3cdb32
commit c7a0bde196
2 changed files with 7 additions and 1 deletions

View File

@ -526,6 +526,10 @@ namespace libtorrent
// attempted to connect yet (i.e. it's queued for
// connection attempt).
bool is_queued() const { return m_queued; }
// returns true if this peer has successfully completed its connection
// attempt to the remote end.
bool is_connected() const { return m_connected; }
// called when it's time for this peer_conncetion to actually
// initiate the tcp connection. This may be postponed until

View File

@ -4612,7 +4612,7 @@ namespace libtorrent
{
for (int channel = 0; channel < 2; ++channel)
{
if ((warning & (1 << channel)) == 0) return;
if ((warning & (1 << channel)) == 0) continue;
t->alerts().post_alert(performance_alert(t->get_handle()
, channel == peer_connection::download_channel
? performance_alert::download_limit_too_low
@ -5547,6 +5547,8 @@ namespace libtorrent
size_t peer_connection::try_read(sync_t s, error_code& ec)
{
TORRENT_ASSERT(m_connected);
if (m_quota[download_channel] == 0)
{
ec = asio::error::would_block;