* 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:
rakshasa
2008-11-18 15:11:49 +00:00
parent d05e889317
commit 15ae43a5ea
3 changed files with 9 additions and 7 deletions
+7 -5
View File
@@ -234,7 +234,9 @@ void
DownloadList::close_directly(Download* download) {
if (download->download()->is_active()) {
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())
@@ -519,14 +521,12 @@ void
DownloadList::received_finished(Download* 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
// trigger correctly, also so it can bork on missing data.
hash_queue(download, Download::variable_hashing_last);
} else {
else
confirm_finished(download);
}
}
// 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
// the download.
//
// Obsolete.
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"));
control->core()->download_store()->save(download);
+1 -1
View File
@@ -68,7 +68,7 @@ wstring_width(const std::string& i_str, int width) {
if (length == (size_t)-1) {
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()))
*out++ = '?';
else
+1 -1
View File
@@ -268,7 +268,7 @@ main(int argc, char** argv) {
"view_add = seeding\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_current = seeding,less=d.get_state_changed=\n"