allow torrents to keep running when they encounter an error (such as disk full) but still report the error in the torrent's error string

This commit is contained in:
Arvid Norberg 2011-05-16 07:47:21 +00:00
parent ddd9dd4b09
commit 6e23b9f5a6
3 changed files with 6 additions and 5 deletions

View File

@ -1149,9 +1149,8 @@ namespace libtorrent
return;
}
if ((t->is_paused() && (!t->is_auto_managed()
if (t->is_paused() && (!t->is_auto_managed()
|| !m_ses.m_settings.incoming_starts_queued_torrents))
|| t->has_error())
{
// paused torrents will not accept
// incoming connections unless they are auto managed

View File

@ -2677,7 +2677,7 @@ namespace aux {
{
torrent& t = *i->second;
TORRENT_ASSERT(!t.is_aborted());
if (t.statistics().upload_rate() > t.upload_limit() * 9 / 10)
if (t.statistics().upload_rate() * 11 / 10 > t.upload_limit())
++congested_torrents;
else
++uncongested_torrents;

View File

@ -1054,6 +1054,9 @@ namespace libtorrent
if (alerts().should_post<file_error_alert>())
alerts().post_alert(file_error_alert(j.error_file, get_handle(), j.error));
// put the torrent in an error-state
set_error(j.error, j.error_file);
if (j.action == disk_io_job::write)
{
// if we failed to write, stop downloading and just
@ -1067,8 +1070,7 @@ namespace libtorrent
return;
}
// put the torrent in an error-state
set_error(j.error, j.error_file);
// if the error appears to be more serious than a full disk, just pause the torrent
pause();
}