Merge branch 'vfs-support' into master

This commit is contained in:
RH 2021-04-26 10:42:09 +10:00 committed by GitHub
commit ac45a176a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,8 @@ public:
_checksumFileName = filename + ".chksum"; _checksumFileName = filename + ".chksum";
_fsMd5 = FileUtils::getInstance()->openFileStream(_checksumFileName, FileStream::Mode::WRITE); _fsMd5 = FileUtils::getInstance()->openFileStream(_checksumFileName, FileStream::Mode::WRITE);
if (_fsMd5->seek(0, SEEK_END) != sizeof(md5_state_s)) { _fsMd5->seek(0, SEEK_END);
if (_fsMd5->tell() != sizeof(md5_state_s)) {
md5_init(&_md5State); md5_init(&_md5State);
} else { } else {
_fsMd5->seek(0, SEEK_SET); _fsMd5->seek(0, SEEK_SET);
@ -822,7 +823,8 @@ void DownloaderCURL::_onDownloadFinished(TaskWrapper&& wrapper, int checkState)
FileStream* fsOrigin = FileStream* fsOrigin =
FileUtils::getInstance()->openFileStream(coTask._fileName, FileStream::Mode::READ); FileUtils::getInstance()->openFileStream(coTask._fileName, FileStream::Mode::READ);
if (fsOrigin) { if (fsOrigin) {
task.progressInfo.totalBytesExpected = fsOrigin->seek(0, SEEK_END); fsOrigin->seek(0, SEEK_END);
task.progressInfo.totalBytesExpected = fsOrigin->tell();
task.progressInfo.bytesReceived = task.progressInfo.totalBytesExpected; task.progressInfo.bytesReceived = task.progressInfo.totalBytesExpected;
task.progressInfo.totalBytesReceived = task.progressInfo.totalBytesExpected; task.progressInfo.totalBytesReceived = task.progressInfo.totalBytesExpected;
task.progressInfo.speedInBytes = task.progressInfo.totalBytesExpected; task.progressInfo.speedInBytes = task.progressInfo.totalBytesExpected;