Changeset 1161


Ignore:
Timestamp:
04/10/10 03:05:39 (4 years ago)
Author:
rakshasa
Message:
  • Don't throw an exception on 'download->resume_flags() != ~uint32_t()' as there seems to be a race condition where a torrent doing the final hashing might get some flags set. Instead just clear it and hope nothing bad happens. See #1292.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/rtorrent/src/core/download_list.cc

    r1160 r1161  
    601601  rpc::commands.call_catch("event.download.finished", rpc::make_target(download), torrent::Object(), "Download event action failed: "); 
    602602 
    603   if (download->resume_flags() != ~uint32_t()) 
    604     throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t()."); 
     603//   if (download->resume_flags() != ~uint32_t()) 
     604//     throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t()."); 
     605 
     606  // See #1292. 
     607  // 
     608  // Just reset the value for the moment. If a torrent finishes while 
     609  // others are hashing, or some other situtation that causes resume 
     610  // flag to change could cause the state to be invalid. 
     611  // 
     612  // TODO: Add a check when setting the flags to see if the torrent is 
     613  // being hashed. 
     614  download->set_resume_flags(~uint32_t()); 
    605615 
    606616  if (!download->is_active() && rpc::call_command_value("d.state", rpc::make_target(download)) == 1) 
Note: See TracChangeset for help on using the changeset viewer.