mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 12:46:18 +00:00
* Do session save on exit from the main loop, and moved around
hash_resume_save. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@680 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -155,6 +155,11 @@ DownloadList::erase(iterator itr) {
|
|||||||
return base_type::erase(itr);
|
return base_type::erase(itr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void
|
||||||
|
// DownloadList::save(Download* d) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::open(Download* download) {
|
DownloadList::open(Download* download) {
|
||||||
try {
|
try {
|
||||||
@@ -204,7 +209,9 @@ DownloadList::close_throw(Download* download) {
|
|||||||
// better crash protection, save regulary in addition to this.
|
// better crash protection, save regulary in addition to this.
|
||||||
//
|
//
|
||||||
// Used to be in pause, but this was wrong for rehashing etc.
|
// Used to be in pause, but this was wrong for rehashing etc.
|
||||||
control->core()->download_store()->save(download);
|
//
|
||||||
|
// Reconsider this save. Should be done explicitly when shutting down.
|
||||||
|
//control->core()->download_store()->save(download);
|
||||||
control->core()->hash_queue()->remove(download);
|
control->core()->hash_queue()->remove(download);
|
||||||
|
|
||||||
download->download()->close();
|
download->download()->close();
|
||||||
@@ -311,11 +318,6 @@ DownloadList::pause(Download* download) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
DownloadList::save(Download* d) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::check_hash(Download* download) {
|
DownloadList::check_hash(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
@@ -337,7 +339,10 @@ DownloadList::check_hash_throw(Download* download) {
|
|||||||
|
|
||||||
close_throw(download);
|
close_throw(download);
|
||||||
download->download()->hash_resume_clear();
|
download->download()->hash_resume_clear();
|
||||||
|
|
||||||
open_throw(download);
|
open_throw(download);
|
||||||
|
download->download()->hash_resume_save();
|
||||||
|
|
||||||
|
|
||||||
// If any more stuff is added here, make sure resume etc are still
|
// If any more stuff is added here, make sure resume etc are still
|
||||||
// correct.
|
// correct.
|
||||||
@@ -427,12 +432,12 @@ DownloadList::confirm_finished(Download* download) {
|
|||||||
|
|
||||||
download->download()->tracker_list().send_completed();
|
download->download()->tracker_list().send_completed();
|
||||||
|
|
||||||
|
download->download()->hash_resume_save();
|
||||||
|
|
||||||
// Do this before the slots are called in case one of them closes
|
// Do this before the slots are called in case one of them closes
|
||||||
// the download.
|
// the download.
|
||||||
if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1) {
|
if (!download->is_active() && control->variable()->get_value("session_on_completion") == 1)
|
||||||
download->download()->hash_resume_save();
|
|
||||||
control->core()->download_store()->save(download);
|
control->core()->download_store()->save(download);
|
||||||
}
|
|
||||||
|
|
||||||
std::for_each(m_slotMapFinished.begin(), m_slotMapFinished.end(), download_list_call(download));
|
std::for_each(m_slotMapFinished.begin(), m_slotMapFinished.end(), download_list_call(download));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ public:
|
|||||||
void erase(Download* d);
|
void erase(Download* d);
|
||||||
iterator erase(iterator itr);
|
iterator erase(iterator itr);
|
||||||
|
|
||||||
|
//void save(Download* d);
|
||||||
|
|
||||||
void open(Download* d);
|
void open(Download* d);
|
||||||
void open_throw(Download* d);
|
void open_throw(Download* d);
|
||||||
|
|
||||||
@@ -97,8 +99,6 @@ public:
|
|||||||
void resume(Download* d);
|
void resume(Download* d);
|
||||||
void pause(Download* d);
|
void pause(Download* d);
|
||||||
|
|
||||||
void save(Download* d);
|
|
||||||
|
|
||||||
void check_hash(Download* d);
|
void check_hash(Download* d);
|
||||||
void check_hash_throw(Download* d);
|
void check_hash_throw(Download* d);
|
||||||
|
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ main(int argc, char** argv) {
|
|||||||
control->core()->get_poll_manager()->poll(client_next_timeout());
|
control->core()->get_poll_manager()->poll(client_next_timeout());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
control->core()->download_list()->session_save();
|
||||||
|
|
||||||
control->cleanup();
|
control->cleanup();
|
||||||
|
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user