From b5cc7cff44c265ca33f2eaef7c76184ca6594841 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sun, 5 Nov 2006 13:38:50 +0000 Subject: [PATCH] * Check if a file in the torrent is a directory when calling EntryList::open. * Removed preload_min_pipelined option and added preload_type, which disables preload on 0, uses madvise willneed on 1 and does direct touching of the pages on 2. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@801 e378c898-3ddf-0310-93e7-cc216c733640 --- src/option_handler_rules.cc | 7 ++++--- src/ui/download.cc | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/option_handler_rules.cc b/src/option_handler_rules.cc index dfa84521..37c3e0c1 100644 --- a/src/option_handler_rules.cc +++ b/src/option_handler_rules.cc @@ -514,14 +514,15 @@ initialize_option_handler(Control* c) { 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("preload_min_pipelined", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::preload_min_pipelined), - rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_preload_min_pipelined))); + variables->insert("preload_type", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::preload_type), + rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_preload_type))); variables->insert("preload_min_size", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::preload_min_size), rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_preload_min_size))); variables->insert("preload_required_rate", new utils::VariableValueSlot(rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::preload_required_rate), - rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_preload_required_rate))); + rak::mem_fn(torrent::chunk_manager(), &torrent::ChunkManager::set_preload_required_rate), + 0, (1 << 10))); variables->insert("port_range", new utils::VariableStringSlot(rak::value_fn(std::string()), rak::bind_ptr_fn(&apply_port_range, c))); diff --git a/src/ui/download.cc b/src/ui/download.cc index 2695532e..0c550cd1 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -176,6 +176,7 @@ Download::create_info() { element->push_column("Upload:", te_variable_value("up_rate", value_base::flag_kb), " KB / ", te_variable_value("up_total", value_base::flag_xb)); element->push_column("Download:", te_variable_value("down_rate", value_base::flag_kb), " KB / ", te_variable_value("down_total", value_base::flag_xb)); element->push_column("Skipped:", te_variable_value("skip_rate", value_base::flag_kb), " KB / ", te_variable_value("skip_total", value_base::flag_xb)); + element->push_column("Preload:", te_value(&torrent::ChunkManager::preload_type), " / ", te_value(&torrent::ChunkManager::stats_preloaded), " / ", te_value(&torrent::ChunkManager::stats_not_preloaded)); element->set_column_width(element->column_width() + 1);