added option to not recheck on missing or incomplete resume data

This commit is contained in:
Arvid Norberg 2011-02-06 00:50:12 +00:00
parent 127fc0bd93
commit ed8779a338
5 changed files with 37 additions and 16 deletions

View File

@ -1,3 +1,4 @@
* added option to not recheck on missing or incomplete resume data
* extended stats logging with statistics=on builds
* added new session functions to more efficiently query torrent status
* added alerts for added and removed torrents

View File

@ -4263,6 +4263,7 @@ session_settings
bool enable_incoming_tcp;
int max_pex_peers;
bool ignore_resume_timestamps;
bool no_recheck_incomplete_resume;
bool anonymous_mode;
int tick_interval;
int share_mode_target;
@ -4981,6 +4982,13 @@ It might be useful to set this to true if your network is faster than your
disk, and it would be faster to redownload potentially missed pieces than
to go through the whole storage to look for them.
``no_recheck_incomplete_resume`` determines if the storage should check
the whole files when resume data is incomplete or missing or whether
it should simply assume we don't have any of the data. By default, this
is determined by the existance of any of the files. By setting this setting
to true, the files won't be checked, but will go straight to download
mode.
``anonymous_mode`` defaults to false. When set to true, the client tries
to hide its identity to a certain degree. The peer-ID will no longer
include the client's fingerprint. The user-agent will be reset to an

View File

@ -233,6 +233,7 @@ namespace libtorrent
, enable_incoming_tcp(true)
, max_pex_peers(200)
, ignore_resume_timestamps(false)
, no_recheck_incomplete_resume(false)
, anonymous_mode(false)
, tick_interval(100)
, report_web_seed_downloads(true)
@ -912,6 +913,12 @@ namespace libtorrent
// since the last session
bool ignore_resume_timestamps;
// normally, if a resume file is incomplete (typically there's no
// "file sizes" field) the torrent is queued for a full check. If
// this settings is set to true, instead libtorrent will assume
// we have none of the files and go straight to download
bool no_recheck_incomplete_resume;
// when this is true, libtorrent will take actions to make sure any
// privacy sensitive information is leaked out from the client. This
// mode is assumed to be combined with using a proxy for all your

View File

@ -331,6 +331,7 @@ namespace aux {
TORRENT_SETTING(boolean, enable_incoming_tcp)
TORRENT_SETTING(integer, max_pex_peers)
TORRENT_SETTING(boolean, ignore_resume_timestamps)
TORRENT_SETTING(boolean, no_recheck_incomplete_resume)
TORRENT_SETTING(boolean, anonymous_mode)
TORRENT_SETTING(integer, tick_interval)
TORRENT_SETTING(integer, upload_rate_limit)
@ -1491,6 +1492,7 @@ namespace aux {
|| m_settings.volatile_read_cache != s.volatile_read_cache
|| m_settings.no_atime_storage!= s.no_atime_storage
|| m_settings.ignore_resume_timestamps != s.ignore_resume_timestamps
|| m_settings.no_recheck_incomplete_resume != s.no_recheck_incomplete_resume
|| m_settings.low_prio_disk != s.low_prio_disk)
update_disk_io_thread = true;

View File

@ -1971,25 +1971,28 @@ ret:
int piece_manager::check_no_fastresume(error_code& error)
{
bool has_files = m_storage->has_any_file();
if (m_storage->error())
return fatal_disk_error;
if (has_files)
bool has_files = false;
if (!m_storage->settings().no_recheck_incomplete_resume)
{
m_state = state_full_check;
m_piece_to_slot.clear();
m_piece_to_slot.resize(m_files.num_pieces(), has_no_slot);
m_slot_to_piece.clear();
m_slot_to_piece.resize(m_files.num_pieces(), unallocated);
if (m_storage_mode == storage_mode_compact)
m_storage->has_any_file();
if (m_storage->error())
return fatal_disk_error;
if (has_files)
{
m_unallocated_slots.clear();
m_free_slots.clear();
m_state = state_full_check;
m_piece_to_slot.clear();
m_piece_to_slot.resize(m_files.num_pieces(), has_no_slot);
m_slot_to_piece.clear();
m_slot_to_piece.resize(m_files.num_pieces(), unallocated);
if (m_storage_mode == storage_mode_compact)
{
m_unallocated_slots.clear();
m_free_slots.clear();
}
TORRENT_ASSERT(int(m_piece_to_slot.size()) == m_files.num_pieces());
return need_full_check;
}
TORRENT_ASSERT(int(m_piece_to_slot.size()) == m_files.num_pieces());
return need_full_check;
}
if (m_storage_mode == storage_mode_compact)