updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / rtorrent-extended / fix_fatal_exception.patch
bloba219fe6c4582184d4a3b66c9624d5abd0d9720be
1 diff --git a/src/core/download_list.cc b/src/core/download_list.cc
2 index 13df725..2aaf3d0 100644
3 --- a/src/core/download_list.cc
4 +++ b/src/core/download_list.cc
5 @@ -577,8 +577,18 @@ DownloadList::confirm_finished(Download* download) {
7 rpc::commands.call_catch("event.download.finished", rpc::make_target(download), torrent::Object(), "Download event action failed: ");
9 - if (download->resume_flags() != ~uint32_t())
10 - throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t().");
11 +// if (download->resume_flags() != ~uint32_t())
12 +// throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t().");
14 + // See #1292.
15 + //
16 + // Just reset the value for the moment. If a torrent finishes while
17 + // others are hashing, or some other situtation that causes resume
18 + // flag to change could cause the state to be invalid.
19 + //
20 + // TODO: Add a check when setting the flags to see if the torrent is
21 + // being hashed.
22 + download->set_resume_flags(~uint32_t());
24 if (!download->is_active() && rpc::call_command_value("d.get_state", rpc::make_target(download)) == 1)
25 resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | torrent::Download::start_keep_baseline);