Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-10-30 17:47:43 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:46:29 +0300
commit65dd7e4f2bee7f55c52c02e8d5e6e2175ae9cd4b (patch)
tree1b18fc45a939b76a029f6a03ec0c0f05c8ab971c /platform/http_request.cpp
parentb90719b6cb1b5f09fd047ff61fe93003cbabb360 (diff)
Don't do space reserving in downloader. It's too slow on a device.
Diffstat (limited to 'platform/http_request.cpp')
-rw-r--r--platform/http_request.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/http_request.cpp b/platform/http_request.cpp
index 8c4f503065..4b1924a136 100644
--- a/platform/http_request.cpp
+++ b/platform/http_request.cpp
@@ -279,7 +279,7 @@ public:
{
// Check that resume information is correct with existing file.
uint64_t size;
- if (my::GetFileSize(filePath + DOWNLOADING_FILE_EXTENSION, size) && size == fileSize)
+ if (my::GetFileSize(filePath + DOWNLOADING_FILE_EXTENSION, size) && size <= fileSize)
openMode = FileWriter::OP_WRITE_EXISTING;
else
m_strategy.InitChunks(fileSize, chunkSize);
@@ -287,7 +287,8 @@ public:
// Create file and reserve needed size.
scoped_ptr<FileWriter> writer(new FileWriter(filePath + DOWNLOADING_FILE_EXTENSION, openMode));
- writer->Reserve(fileSize);
+ // Reserving disk space is very slow on a device.
+ //writer->Reserve(fileSize);
// Assign here, because previous functions can throw an exception.
m_writer.swap(writer);