forked from premiere/premiere-libtorrent
merged fixes from RC_0_16
This commit is contained in:
parent
cff82fa319
commit
b643962bfe
|
@ -605,17 +605,17 @@ namespace libtorrent
|
|||
int default_storage::sparse_end(int slot) const
|
||||
{
|
||||
TORRENT_ASSERT(slot >= 0);
|
||||
TORRENT_ASSERT(slot < m_files.num_pieces());
|
||||
TORRENT_ASSERT(slot < files().num_pieces());
|
||||
|
||||
size_type file_offset = (size_type)slot * m_files.piece_length();
|
||||
size_type file_offset = (size_type)slot * files().piece_length();
|
||||
int file_index = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (file_offset < m_files.file_size(file_index))
|
||||
if (file_offset < files().file_size(file_index))
|
||||
break;
|
||||
|
||||
file_offset -= m_files.file_size(file_index);
|
||||
file_offset -= files().file_size(file_index);
|
||||
++file_index;
|
||||
TORRENT_ASSERT(file_index != files().num_files());
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ namespace libtorrent
|
|||
if (!file_handle || ec) return slot;
|
||||
|
||||
size_type data_start = file_handle->sparse_end(file_offset);
|
||||
return int((data_start + m_files.piece_length() - 1) / m_files.piece_length());
|
||||
return int((data_start + files().piece_length() - 1) / files().piece_length());
|
||||
}
|
||||
|
||||
bool default_storage::verify_resume_data(lazy_entry const& rd, error_code& error)
|
||||
|
|
|
@ -42,7 +42,7 @@ test_programs = \
|
|||
test_utp \
|
||||
test_session \
|
||||
test_ssl \
|
||||
test_web_seed
|
||||
test_web_seed \
|
||||
test_remap_files
|
||||
|
||||
if ENABLE_TESTS
|
||||
|
|
Loading…
Reference in New Issue