diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-04-24 18:54:59 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-19 03:43:30 +0200 |
commit | ea2a3c2ab72cc77d7bf90e2ee90134f533794cf5 (patch) | |
tree | 5fb9fdb2f31d64bf8d7c385501844dde8d20c7b7 /desktop | |
parent | b65cf7da60cc7eb9815e094e704d475fe115c23e (diff) |
better reporting for normal response from updater
Change-Id: I26cbd69c46afadc21eeab73cbccddc6873c43655
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/updater.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index a0e0e3bf4f6f..388c45e7211e 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -194,6 +194,7 @@ struct update_info { OUString aFromBuildID; OUString aSeeAlsoURL; + OUString aMessage; update_file aUpdateFile; std::vector<language_file> aLanguageFiles; @@ -356,6 +357,13 @@ update_info parse_response(const std::string& rResponse) { throw invalid_update_info(); } + else if (std::find(aRootKeys.begin(), aRootKeys.end(), "response") != aRootKeys.end()) + { + update_info aUpdateInfo; + auto aMsgNode = aDocumentRoot.child("response"); + aUpdateInfo.aMessage = toOUString(aMsgNode.string_value().str()); + return aUpdateInfo; + } orcus::json::detail::node aFromNode = aDocumentRoot.child("from"); if (aFromNode.type() != orcus::json_node_t::string) @@ -544,8 +552,17 @@ void update_checker() if (!response_body.empty()) { update_info aUpdateInfo = parse_response(response_body); - download_file(aUpdateInfo.aUpdateFile.aURL, aUpdateInfo.aUpdateFile.nSize, aUpdateInfo.aUpdateFile.aHash, "update.mar"); - CreateValidUpdateDir(aUpdateInfo); + if (aUpdateInfo.aUpdateFile.aURL.isEmpty()) + { + // No update currently available + // add entry to updating.log with the message + SAL_WARN("desktop.updater", "Message received from the updater: " << aUpdateInfo.aMessage); + } + else + { + download_file(aUpdateInfo.aUpdateFile.aURL, aUpdateInfo.aUpdateFile.nSize, aUpdateInfo.aUpdateFile.aHash, "update.mar"); + CreateValidUpdateDir(aUpdateInfo); + } } } catch (const invalid_update_info&) |