mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-19 07:36:16 +00:00
* Make 'seeding' view trigger filtering on 'event.download.finished'.
* Fixed a potential buffer overflow in displaying of non-UTF8 filenames. * Changed torrent::DownloadList::close_directly() so doesn't save the session if the underlying file/directory has been moved or removed. This change, in addition to calling 'd.set_directory=' before 'execute=mv,...', as previously shown in the examples, will make rtorrent behave correctly when 'check_hash=no' is set. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1084 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -234,7 +234,9 @@ void
|
|||||||
DownloadList::close_directly(Download* download) {
|
DownloadList::close_directly(Download* download) {
|
||||||
if (download->download()->is_active()) {
|
if (download->download()->is_active()) {
|
||||||
download->download()->stop(torrent::Download::stop_skip_tracker);
|
download->download()->stop(torrent::Download::stop_skip_tracker);
|
||||||
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
|
|
||||||
|
if (torrent::resume_check_target_files(*download->download(), download->download()->bencode()->get_key("libtorrent_resume")))
|
||||||
|
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (download->download()->is_open())
|
if (download->download()->is_open())
|
||||||
@@ -519,14 +521,12 @@ void
|
|||||||
DownloadList::received_finished(Download* download) {
|
DownloadList::received_finished(Download* download) {
|
||||||
check_contains(download);
|
check_contains(download);
|
||||||
|
|
||||||
if (rpc::call_command_value("get_check_hash")) {
|
if (rpc::call_command_value("get_check_hash"))
|
||||||
// Set some 'checking_finished_thingie' variable to make hash_done
|
// Set some 'checking_finished_thingie' variable to make hash_done
|
||||||
// trigger correctly, also so it can bork on missing data.
|
// trigger correctly, also so it can bork on missing data.
|
||||||
hash_queue(download, Download::variable_hashing_last);
|
hash_queue(download, Download::variable_hashing_last);
|
||||||
|
else
|
||||||
} else {
|
|
||||||
confirm_finished(download);
|
confirm_finished(download);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The download must be open when we call this function.
|
// The download must be open when we call this function.
|
||||||
@@ -547,6 +547,8 @@ DownloadList::confirm_finished(Download* download) {
|
|||||||
|
|
||||||
// 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.
|
||||||
|
//
|
||||||
|
// Obsolete.
|
||||||
if (!download->is_active() && rpc::call_command_value("get_session_on_completion") != 0) {
|
if (!download->is_active() && rpc::call_command_value("get_session_on_completion") != 0) {
|
||||||
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
|
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
|
||||||
control->core()->download_store()->save(download);
|
control->core()->download_store()->save(download);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ wstring_width(const std::string& i_str, int width) {
|
|||||||
if (length == (size_t)-1) {
|
if (length == (size_t)-1) {
|
||||||
wchar_t* out = result;
|
wchar_t* out = result;
|
||||||
|
|
||||||
for (std::string::const_iterator itr = i_str.begin(); itr != i_str.end(); ++itr)
|
for (std::string::const_iterator itr = i_str.begin(); out != result + width && itr != i_str.end(); ++itr)
|
||||||
if (!std::isprint(*itr, std::locale::classic()))
|
if (!std::isprint(*itr, std::locale::classic()))
|
||||||
*out++ = '?';
|
*out++ = '?';
|
||||||
else
|
else
|
||||||
|
|||||||
+1
-1
@@ -268,7 +268,7 @@ main(int argc, char** argv) {
|
|||||||
|
|
||||||
"view_add = seeding\n"
|
"view_add = seeding\n"
|
||||||
"view_filter = seeding,\"and=d.get_state=,d.get_complete=\"\n"
|
"view_filter = seeding,\"and=d.get_state=,d.get_complete=\"\n"
|
||||||
"view_filter_on = seeding,event.download.resumed,event.download.paused\n"
|
"view_filter_on = seeding,event.download.resumed,event.download.paused,event.download.finished\n"
|
||||||
"view_sort_new = seeding,less=d.get_state_changed=\n"
|
"view_sort_new = seeding,less=d.get_state_changed=\n"
|
||||||
"view_sort_current = seeding,less=d.get_state_changed=\n"
|
"view_sort_current = seeding,less=d.get_state_changed=\n"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user