From acfe3d1e705b7a6a877c24982235e01121d08475 Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 25 Mar 2015 17:36:03 +0300 Subject: [PATCH] [storage] Skip download of empty routing file. --- storage/storage.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/storage.cpp b/storage/storage.cpp index aee7f9f6d6..bf8f9f44a2 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -54,7 +54,13 @@ namespace storage : m_index(index), m_init(opt), m_left(opt) { m_pFile = &(storage.CountryByIndex(index).GetFile()); - m_current = (m_init & TMapOptions::ECarRouting ? TMapOptions::ECarRouting : TMapOptions::EMapOnly); + + // Don't queue files with 0-size on server (empty or absent). + // Downloader has lots of assertions about it. + if ((m_init & TMapOptions::ECarRouting) && (m_pFile->GetRemoteSize(TMapOptions::ECarRouting) > 0)) + m_current = TMapOptions::ECarRouting; + else + m_init = m_current = m_left = TMapOptions::EMapOnly; } void Storage::QueuedCountry::AddOptions(TMapOptions opt)