Browse Source

Log edition name instead of abbreviation in standalone adapter.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
8d911c559e
3 changed files with 15 additions and 4 deletions
  1. +1
    -1
      adapters/standalone.cpp
  2. +12
    -3
      src/library.cpp
  3. +2
    -0
      src/network.cpp

+ 1
- 1
adapters/standalone.cpp View File

@@ -128,7 +128,7 @@ int main(int argc, char* argv[]) {
}

// Log environment
INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION.c_str(), APP_VERSION.c_str());
INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION_NAME.c_str(), APP_VERSION.c_str());
INFO("%s", system::getOperatingSystemInfo().c_str());
std::string argsList;
for (int i = 0; i < argc; i++) {


+ 12
- 3
src/library.cpp View File

@@ -154,6 +154,15 @@ void checkUpdates() {

updateStatus = "Querying for updates...";

// Check user token
std::string userUrl = API_URL + "/user";
json_t* userResJ = network::requestJson(network::METHOD_GET, userUrl, NULL, getTokenCookies());
if (!userResJ) {
DEBUG("User failed");
return;
}
DEFER({json_decref(userResJ);});

// Get user's plugins list
std::string pluginsUrl = API_URL + "/plugins";
json_t* pluginsResJ = network::requestJson(network::METHOD_GET, pluginsUrl, NULL, getTokenCookies());
@@ -219,9 +228,9 @@ void checkUpdates() {
}
update.version = json_string_value(versionJ);
// Reject plugins with ABI mismatch
// if (!string::startsWith(update.version, APP_VERSION_MAJOR + ".")) {
// continue;
// }
if (!string::startsWith(update.version, APP_VERSION_MAJOR + ".")) {
continue;
}

// Check if update is needed
plugin::Plugin* p = plugin::getPlugin(slug);


+ 2
- 0
src/network.cpp View File

@@ -138,6 +138,8 @@ json_t* requestJson(Method method, const std::string& url, json_t* dataJ, const
curl_easy_cleanup(curl);
curl_slist_free_all(headers);

DEBUG("response: %s", resText.c_str());

if (res != CURLE_OK) {
WARN("Could not request %s: %s", urlS.c_str(), curl_easy_strerror(res));
return NULL;


Loading…
Cancel
Save