From bfa752367724fda6fdec6442f8d7ae717ea2d4ae Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 5 Jul 2008 12:01:00 +0000 Subject: [PATCH] * Fix a crash in DHT due to returning a reference to a temporary variable. Patch by Josef Drexler for ticket #1221. * Fix an off-by-one error that causes a crash if a DHT node advertises an ID of "FFFFFFFF...". Patch by Josef Drexler. * Fix a crash in initial seeding to due a typo not passing the right flag. Patch by Josef Drexler. * Fix d.connection_seed being set to "leech" when download wasn't set to initial_seed. Patch by Josef Drexler for ticket #1376. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1061 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/download_list.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 3a0f268d..cbcb55ed 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -399,7 +399,8 @@ DownloadList::pause(Download* download, int flags) { rpc::call_command("d.set_state_counter", rpc::call_command_value("d.get_state_counter", rpc::make_target(download)), rpc::make_target(download)); // If initial seeding is complete, don't try it again when restarting. - if (download->is_done()) + if (download->is_done() && + rpc::call_command_void("d.get_connection_current", rpc::make_target(download)).as_string() == "initial_seed") rpc::call_command("d.set_connection_seed", rpc::call_command_void("d.get_connection_current", rpc::make_target(download)), rpc::make_target(download)); // Save the state after all the slots, etc have been called so we