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:
authorAlex Zolotarev <deathbaba@gmail.com>2012-11-07 03:11:05 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:46:38 +0300
commite76cf411e3912c8969ea49d5c0b4b8a2545784bc (patch)
treedcae211393b6653d3c554baa069f32736ffc075b /platform
parent1cfc7b0e17ac2bd1726678d6e70d89b741d3f303 (diff)
[ios] Fixed corrupted file download by explicit file size checking in all cases
Diffstat (limited to 'platform')
-rw-r--r--platform/http_thread_apple.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/http_thread_apple.mm b/platform/http_thread_apple.mm
index 79a430bd12..7a7c115555 100644
--- a/platform/http_thread_apple.mm
+++ b/platform/http_thread_apple.mm
@@ -134,7 +134,8 @@
// if it's absent, use Content-Length instead
if (sizeOnServer < 0)
sizeOnServer = [response expectedContentLength];
- if (sizeOnServer > 0 & m_expectedSize != sizeOnServer)
+ // We should always check returned size, even if it's invalid (-1)
+ if (m_expectedSize != sizeOnServer)
{
LOG(LWARNING, ("Canceling download - server replied with invalid size",
@@ -143,6 +144,7 @@
m_callback->OnFinish(-2, m_begRange, m_endRange);
return;
}
+ // @TODO Else display content to user - router is redirecting us somewhere
}
}
else