Ticket #1510: rtorrent-9999-finished[1].patch

File rtorrent-9999-finished[1].patch, 1.2 KB (added by sirjaren <sirjaren@gmail.com>, 2 years ago)
  • src/core/download_list.cc

    old new  
    598598  // up/downloaded baseline. 
    599599  download->download()->tracker_list()->send_completed(); 
    600600 
     601  // save the hash in case the event deletes the object (e.g. d.erase) 
     602  torrent::HashString infohash = download->info()->hash(); 
     603 
    601604  rpc::commands.call_catch("event.download.finished", rpc::make_target(download), torrent::Object(), "Download event action failed: "); 
    602605 
    603606//   if (download->resume_flags() != ~uint32_t()) 
     
    613616  // being hashed. 
    614617  download->set_resume_flags(~uint32_t()); 
    615618 
    616   if (!download->is_active() && rpc::call_command_value("d.state", rpc::make_target(download)) == 1) 
    617     resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | torrent::Download::start_keep_baseline); 
     619  if (find(infohash) != end()) { 
     620        if (!download->is_active() && rpc::call_command_value("d.get_state", rpc::make_target(download)) == 1) 
     621          resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | torrent::Download::start_keep_baseline); 
     622  } 
     623 
    618624} 
    619625 
    620626void