client_test fix: saves resume data when torrents are manually paused or resumed, to not loose that state
This commit is contained in:
parent
f04e9e9875
commit
89c7a3168b
|
@ -586,7 +586,7 @@ void scan_dir(path const& dir_path
|
||||||
h.auto_managed(false);
|
h.auto_managed(false);
|
||||||
h.pause();
|
h.pause();
|
||||||
// the alert handler for save_resume_data_alert
|
// the alert handler for save_resume_data_alert
|
||||||
// will save it to disk and remove the torrent
|
// will save it to disk
|
||||||
h.save_resume_data();
|
h.save_resume_data();
|
||||||
|
|
||||||
handles.erase(i++);
|
handles.erase(i++);
|
||||||
|
@ -635,6 +635,8 @@ void handle_alert(libtorrent::session& ses, libtorrent::alert* a
|
||||||
p->handle.set_max_connections(30);
|
p->handle.set_max_connections(30);
|
||||||
|
|
||||||
// write resume data for the finished torrent
|
// write resume data for the finished torrent
|
||||||
|
// the alert handler for save_resume_data_alert
|
||||||
|
// will save it to disk
|
||||||
torrent_handle h = p->handle;
|
torrent_handle h = p->handle;
|
||||||
h.save_resume_data();
|
h.save_resume_data();
|
||||||
}
|
}
|
||||||
|
@ -1184,6 +1186,9 @@ int main(int ac, char* av[])
|
||||||
h.auto_managed(false);
|
h.auto_managed(false);
|
||||||
h.pause();
|
h.pause();
|
||||||
}
|
}
|
||||||
|
// the alert handler for save_resume_data_alert
|
||||||
|
// will save it to disk
|
||||||
|
h.save_resume_data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue