From 3499913c59bcf43e1fd376e29d8a900a8f4611ac Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 31 Mar 2009 08:20:34 +0000 Subject: [PATCH] storage compact mode resume data fix --- src/file.cpp | 2 +- src/storage.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index c6f41b674..04ba62156 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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; diff --git a/src/storage.cpp b/src/storage.cpp index c54da57c9..f9e57c95a 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -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()