exception fixes
This commit is contained in:
@@ -949,7 +949,18 @@ namespace libtorrent { namespace detail
|
||||
continue;
|
||||
}
|
||||
|
||||
c.keep_alive();
|
||||
try
|
||||
{
|
||||
c.keep_alive();
|
||||
}
|
||||
catch (std::exception& exc)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
(*c.m_logger) << "**ERROR**: " << exc.what() << "\n";
|
||||
#endif
|
||||
c.set_failed();
|
||||
c.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// check each torrent for tracker updates
|
||||
@@ -981,7 +992,6 @@ namespace libtorrent { namespace detail
|
||||
}
|
||||
|
||||
m_stat.second_tick(tick_interval);
|
||||
|
||||
// distribute the maximum upload rate among the torrents
|
||||
|
||||
assert(m_max_uploads >= -1);
|
||||
|
@@ -2454,13 +2454,25 @@ namespace libtorrent
|
||||
}
|
||||
|
||||
for (peer_iterator i = m_connections.begin();
|
||||
i != m_connections.end(); ++i)
|
||||
i != m_connections.end();)
|
||||
{
|
||||
peer_connection* p = i->second;
|
||||
++i;
|
||||
m_stat += p->statistics();
|
||||
// updates the peer connection's ul/dl bandwidth
|
||||
// resource requests
|
||||
p->second_tick(tick_interval);
|
||||
try
|
||||
{
|
||||
p->second_tick(tick_interval);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
(*p->m_logger) << "**ERROR**: " << e.what() << "\n";
|
||||
#endif
|
||||
p->set_failed();
|
||||
p->disconnect();
|
||||
}
|
||||
}
|
||||
accumulator += m_stat;
|
||||
m_stat.second_tick(tick_interval);
|
||||
|
Reference in New Issue
Block a user