mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 05:32:31 +00:00
* Initial seeding support added. Patch by Josef Drexler.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1058 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -195,10 +195,6 @@ DownloadFactory::receive_success() {
|
||||
if (!rtorrent->has_key_string("custom4")) rtorrent->insert_key("custom4", std::string());
|
||||
if (!rtorrent->has_key_string("custom5")) rtorrent->insert_key("custom5", std::string());
|
||||
|
||||
// Move to 'rtorrent'.
|
||||
rpc::call_command("d.set_connection_leech", m_variables["connection_leech"], rpc::make_target(download));
|
||||
rpc::call_command("d.set_connection_seed", m_variables["connection_seed"], rpc::make_target(download));
|
||||
|
||||
rpc::call_command("d.set_uploads_max", rpc::call_command_void("get_max_uploads"), rpc::make_target(download));
|
||||
rpc::call_command("d.set_peers_min", rpc::call_command_void("get_min_peers"), rpc::make_target(download));
|
||||
rpc::call_command("d.set_peers_max", rpc::call_command_void("get_max_peers"), rpc::make_target(download));
|
||||
@@ -352,6 +348,9 @@ DownloadFactory::initialize_rtorrent(Download* download, torrent::Object* rtorre
|
||||
download->download()->file_list()->size_chunks()));
|
||||
|
||||
rtorrent->insert_preserve_copy("ignore_commands", (int64_t)0);
|
||||
|
||||
rtorrent->insert_preserve_type("connection_leech", m_variables["connection_leech"]);
|
||||
rtorrent->insert_preserve_type("connection_seed", m_variables["connection_seed"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -398,6 +398,10 @@ DownloadList::pause(Download* download, int flags) {
|
||||
rpc::call_command("d.set_state_changed", cachedTime.seconds(), rpc::make_target(download));
|
||||
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())
|
||||
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
|
||||
// include the modifications they may make.
|
||||
//control->core()->download_store()->save(download);
|
||||
|
||||
Reference in New Issue
Block a user