never finalize pad files

This commit is contained in:
Arvid Norberg 2010-03-21 18:19:59 +00:00
parent 126ba1fd34
commit 8724b89499
1 changed files with 8 additions and 5 deletions

View File

@ -2120,12 +2120,15 @@ namespace libtorrent
if (m_file_progress[file_index] >= m_torrent_file->files().at(file_index).size)
{
filesystem().async_finalize_file(file_index);
if (m_ses.m_alerts.should_post<piece_finished_alert>())
if (!m_torrent_file->files().at(file_index).pad_file)
{
// this file just completed, post alert
m_ses.m_alerts.post_alert(file_completed_alert(get_handle()
, file_index));
filesystem().async_finalize_file(file_index);
if (m_ses.m_alerts.should_post<piece_finished_alert>())
{
// this file just completed, post alert
m_ses.m_alerts.post_alert(file_completed_alert(get_handle()
, file_index));
}
}
}
size -= add;