mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-23 10:52:15 +00:00
ENH: GUI: add arm64 check logic for windows
jira: no-jira Change-Id: Ic788d4ae9218b909eae5ce571d4436c39e77230a (cherry picked from commit 323184e42c5f85c8738b03b890e5aaf3818e8858)
This commit is contained in:
@@ -666,7 +666,7 @@ Http& Http::form_add_file(const std::string &name, const fs::path &path, const s
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// Tells libcurl to ignore certificate revocation checks in case of missing or offline distribution points for those SSL backends where such behavior is present.
|
||||
// Tells libcurl to ignore certificate revocation checks in case of missing or offline distribution points for those SSL backends where such behavior is present.
|
||||
// This option is only supported for Schannel (the native Windows SSL library).
|
||||
Http& Http::ssl_revoke_best_effort(bool set)
|
||||
{
|
||||
@@ -804,6 +804,12 @@ void Http::set_extra_headers(std::map<std::string, std::string> headers)
|
||||
extra_headers.swap(headers);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> Http::get_extra_headers()
|
||||
{
|
||||
std::lock_guard<std::mutex> l(g_mutex);
|
||||
return extra_headers;
|
||||
}
|
||||
|
||||
bool Http::ca_file_supported()
|
||||
{
|
||||
::CURL *curl = ::curl_easy_init();
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
|
||||
//BBS set global header for each http request
|
||||
static void set_extra_headers(std::map<std::string, std::string> headers);
|
||||
static std::map<std::string, std::string> get_extra_headers();
|
||||
|
||||
~Http();
|
||||
|
||||
|
||||
@@ -943,6 +943,16 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (GUI::wxGetApp().is_running_on_arm64()) {
|
||||
//set to arm64 for plugins
|
||||
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
|
||||
current_headers["X-BBL-OS-Type"] = "win_arm64";
|
||||
|
||||
Slic3r::Http::set_extra_headers(current_headers);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("set X-BBL-OS-Type to win_arm64");
|
||||
}
|
||||
#endif
|
||||
try {
|
||||
std::map<std::string, Resource> resources
|
||||
{
|
||||
@@ -953,6 +963,16 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
|
||||
catch (std::exception& e) {
|
||||
BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_plugins: %1%", e.what());
|
||||
}
|
||||
#if defined(__WINDOWS__)
|
||||
if (GUI::wxGetApp().is_running_on_arm64()) {
|
||||
//set back
|
||||
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
|
||||
current_headers["X-BBL-OS-Type"] = "windows";
|
||||
|
||||
Slic3r::Http::set_extra_headers(current_headers);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("set X-BBL-OS-Type back to windows");
|
||||
}
|
||||
#endif
|
||||
|
||||
bool result = get_cached_plugins_version(cached_version, force_upgrade);
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user