From dbde781bc568bf22cd1a976d9b97f929337f5c89 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 19 Jul 2011 08:46:10 +0000 Subject: [PATCH] * Added event name to log printed when a download event fails. * Made 'log_files.cc' printf statements cast uint64_t to 'long long unsigned int'. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1245 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/download_list.cc | 10 ++++++++++ src/core/download_list.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index faa5e585..a4fb5f62 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -74,6 +74,16 @@ DownloadList::check_contains(Download* d) { #endif } +void +DownloadList::trigger_event(Download* d, const char* event_name) { + try { + rpc::commands.call(event_name, rpc::make_target(d), torrent::Object()); + + } catch (torrent::input_error& e) { + control->core()->push_log(("Event '" + std::string(event_name) + "' failed: " + std::string(e.what())).c_str()); + } +} + void DownloadList::clear() { std::for_each(begin(), end(), std::bind1st(std::mem_fun(&DownloadList::close), this)); diff --git a/src/core/download_list.h b/src/core/download_list.h index d4ffb921..13a6f126 100644 --- a/src/core/download_list.h +++ b/src/core/download_list.h @@ -155,6 +155,8 @@ private: DownloadList(const DownloadList&); void operator = (const DownloadList&); + void trigger_event(Download* d, const char* event_name); + void hash_done(Download* d); void hash_queue(Download* d, int type);