fix assert in storage::physical_offset when peers requests pad files
This commit is contained in:
parent
90d8030269
commit
2c07e488b1
|
@ -989,6 +989,12 @@ ret:
|
|||
size_type tor_off = size_type(slot)
|
||||
* files().piece_length() + offset;
|
||||
file_storage::iterator file_iter = files().file_at_offset(tor_off);
|
||||
while (file_iter->pad_file)
|
||||
{
|
||||
++file_iter;
|
||||
if (file_iter == m_files.end())
|
||||
return size_type(slot) * files().piece_length() + offset;
|
||||
}
|
||||
TORRENT_ASSERT(!file_iter->pad_file);
|
||||
|
||||
size_type file_offset = tor_off - file_iter->offset;
|
||||
|
|
Loading…
Reference in New Issue