* Detect the amount of address space available for mapping chunks and

use that to decide when syncing is needed.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@745 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-07-21 20:19:55 +00:00
parent 345c57e9bc
commit 652fd25c07
4 changed files with 7 additions and 19 deletions
-4
View File
@@ -94,10 +94,6 @@ Download::Download(download_type d) :
m_variables.insert("min_peers", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::peers_min), rak::mem_fn(&m_download, &download_type::set_peers_min)));
m_variables.insert("max_peers", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::peers_max), rak::mem_fn(&m_download, &download_type::set_peers_max)));
m_variables.insert("max_uploads", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::uploads_max), rak::mem_fn(&m_download, &download_type::set_uploads_max)));
m_variables.insert("max_chunks_queued", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::max_chunks_queued), rak::mem_fn(&m_download, &download_type::set_max_chunks_queued)));
m_variables.insert("timeout_sync", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::timeout_sync), rak::mem_fn(&m_download, &download_type::set_timeout_sync)));
m_variables.insert("timeout_safe_sync", new utils::VariableValueSlot(rak::mem_fn(&m_download, &download_type::timeout_safe_sync), rak::mem_fn(&m_download, &download_type::set_timeout_safe_sync)));
m_variables.insert("priority", new utils::VariableValueSlot(rak::mem_fn(this, &Download::priority), rak::mem_fn(this, &Download::set_priority)));
-12
View File
@@ -176,18 +176,6 @@ DownloadFactory::receive_success() {
download->variable()->set("max_peers", control->variable()->get("max_peers"));
download->variable()->set("max_uploads", control->variable()->get("max_uploads"));
if (!control->variable()->get_value("timeout_sync") != 0)
download->variable()->set("timeout_sync", control->variable()->get("timeout_sync"));
if (!control->variable()->get_value("timeout_safe_sync") != 0)
download->variable()->set("timeout_safe_sync", control->variable()->get("timeout_safe_sync"));
if (!control->variable()->get_value("max_chunks_queued") != 0)
download->variable()->set("max_chunks_queued", control->variable()->get("max_chunks_queued"));
else
// Temporary until we fix the library.
download->variable()->set("max_chunks_queued", (512 << 20) / download->download()->chunks_size());
if (!control->variable()->get_value("use_udp_trackers"))
download->enable_udp_trackers(false);