* 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);
+1
View File
@@ -104,6 +104,7 @@ WindowPeerInfo::redraw() {
m_canvas->print(0, y++, "Max Memory Usage: %llu MB", torrent::chunk_manager()->max_memory_usage() / (1 << 20));
m_canvas->print(0, y++, "Free Diskspace: %llu MB", m_download->download()->free_diskspace() / (1 << 20));
m_canvas->print(0, y++, "Safe Diskspace: %llu MB", torrent::chunk_manager()->safe_free_diskspace() / (1 << 20));
y++;
+6 -3
View File
@@ -428,9 +428,6 @@ initialize_option_handler(Control* c) {
variables->insert("max_uploads", new utils::VariableValue(15));
variables->insert("max_chunks_queued", new utils::VariableValue(0));
variables->insert("timeout_sync", new utils::VariableValue(0));
variables->insert("timeout_safe_sync", new utils::VariableValue(0));
variables->insert("download_rate", new utils::VariableValueSlot(rak::ptr_fn(&torrent::down_throttle), rak::mem_fn(control->ui(), &ui::Root::set_down_throttle_i64),
0, (1 << 10)));
variables->insert("upload_rate", new utils::VariableValueSlot(rak::ptr_fn(&torrent::up_throttle), rak::mem_fn(control->ui(), &ui::Root::set_up_throttle_i64),
@@ -469,6 +466,12 @@ initialize_option_handler(Control* c) {
variables->insert("max_memory_usage", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::max_memory_usage),
rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_max_memory_usage)));
variables->insert("timeout_sync", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::timeout_sync),
rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_timeout_sync)));
variables->insert("timeout_safe_sync", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::timeout_safe_sync),
rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_timeout_safe_sync)));
variables->insert("port_range", new utils::VariableStringSlot(rak::value_fn(std::string()), rak::bind_ptr_fn(&apply_port_range, c)));
variables->insert("hash_read_ahead", new utils::VariableValueSlot(rak::ptr_fn(torrent::hash_read_ahead), rak::bind_ptr_fn(&apply_hash_read_ahead, c)));