mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 19:33:28 +01:00
updates: we now have a user URL, and an automatic one
So the user can use https, while the automatic does not have to
This commit is contained in:
parent
9f17b1a30f
commit
822577eb42
@ -98,9 +98,9 @@ namespace tools
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string get_update_url(const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version)
|
std::string get_update_url(const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version, bool user)
|
||||||
{
|
{
|
||||||
static const char base[] = "http://updates.getmonero.org/";
|
static const char *base = user ? "https://downloads.getmonero.org/" : "http://updates.getmonero.org/";
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static const char extension[] = ".zip";
|
static const char extension[] = ".zip";
|
||||||
#else
|
#else
|
||||||
|
@ -33,5 +33,5 @@
|
|||||||
namespace tools
|
namespace tools
|
||||||
{
|
{
|
||||||
bool check_updates(const std::string &software, const std::string &buildtag, bool bestnet, std::string &version, std::string &hash);
|
bool check_updates(const std::string &software, const std::string &buildtag, bool bestnet, std::string &version, std::string &hash);
|
||||||
std::string get_update_url(const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version);
|
std::string get_update_url(const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version, bool user);
|
||||||
}
|
}
|
||||||
|
@ -1107,12 +1107,13 @@ namespace cryptonote
|
|||||||
if (tools::vercmp(version.c_str(), MONERO_VERSION) <= 0)
|
if (tools::vercmp(version.c_str(), MONERO_VERSION) <= 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
std::string url = tools::get_update_url(software, subdir, buildtag, version);
|
std::string url = tools::get_update_url(software, subdir, buildtag, version, true);
|
||||||
MGINFO("Version " << version << " of " << software << " for " << buildtag << " is available: " << url << ", SHA256 hash " << hash);
|
MGINFO("Version " << version << " of " << software << " for " << buildtag << " is available: " << url << ", SHA256 hash " << hash);
|
||||||
|
|
||||||
if (check_updates_level == UPDATES_NOTIFY)
|
if (check_updates_level == UPDATES_NOTIFY)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
url = tools::get_update_url(software, subdir, buildtag, version, false);
|
||||||
std::string filename;
|
std::string filename;
|
||||||
const char *slash = strrchr(url.c_str(), '/');
|
const char *slash = strrchr(url.c_str(), '/');
|
||||||
if (slash)
|
if (slash)
|
||||||
|
Loading…
Reference in New Issue
Block a user