storage compact mode resume data fix

This commit is contained in:
Arvid Norberg 2009-03-31 08:20:34 +00:00
parent 91ba36a396
commit 3499913c59
2 changed files with 2 additions and 2 deletions

View File

@ -587,7 +587,7 @@ namespace libtorrent
LARGE_INTEGER offs;
offs.QuadPart = file_offset;
if (SetFilePointerEx(m_file_handle, offs, &offs, SEEK_SET) == FALSE)
if (SetFilePointerEx(m_file_handle, offs, &offs, FILE_BEGIN) == FALSE)
{
ec = error_code(GetLastError(), get_system_category());
return -1;

View File

@ -273,7 +273,7 @@ namespace libtorrent
// in sparse mode, allow the files to be more recent
// than the resume data, but only by 5 minutes
if ((compact_mode && (time > s->second + 1 || time < s->second - 1)) ||
(!compact_mode && (time > s->second + 5 * 60) || time < s->second - 1))
(!compact_mode && (time > s->second + 5 * 60 || time < s->second - 1)))
{
if (error) *error = "timestamp mismatch for file '"
+ i->path.external_file_string()