wsd: Fix incorrect file size reported

Close/flush the file after copying into it so that we can calculate the exact
filesize later on.

Change-Id: I30aca9d0ac3702394a4465c30c61954a726eec39
This commit is contained in:
Pranav Kant 2018-01-18 20:50:35 +05:30
parent c06376cc1d
commit 0547507b67

View file

@ -638,6 +638,7 @@ std::string WopiStorage::loadStorageFileToLocal(const Authorization& auth)
std::copy(std::istreambuf_iterator<char>(rs),
std::istreambuf_iterator<char>(),
std::ostreambuf_iterator<char>(ofs));
ofs.close();
LOG_INF("WOPI::GetFile downloaded " << getFileSize(_jailedFilePath) << " bytes from [" << uriObject.toString() <<
"] -> " << _jailedFilePath << " in " << diff.count() << "s");