Deleted unused function in Octoprint

This commit is contained in:
David Kocik 2021-12-03 09:47:51 +01:00
parent 08e3e60a5f
commit 60b8a8245c
2 changed files with 1 additions and 17 deletions

View File

@ -207,7 +207,7 @@ bool OctoPrint::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Erro
// This new address returns in "test_msg_or_host_ip" variable. // This new address returns in "test_msg_or_host_ip" variable.
// Solves troubles of uploades failing with name address. // Solves troubles of uploades failing with name address.
// in original address (m_host) replace host for resolved ip // in original address (m_host) replace host for resolved ip
url = substitute_host(make_url("api/files/local", m_host), GUI::into_u8(test_msg_or_host_ip)); url = substitute_host(make_url("api/files/local"), GUI::into_u8(test_msg_or_host_ip));
BOOST_LOG_TRIVIAL(info) << "Upload address after ip resolve: " << url; BOOST_LOG_TRIVIAL(info) << "Upload address after ip resolve: " << url;
} }
#endif // _WIN32 #endif // _WIN32
@ -276,21 +276,6 @@ std::string OctoPrint::make_url(const std::string &path) const
} }
} }
std::string OctoPrint::make_url(const std::string& path, const std::string& addr) const
{
std::string hst = addr.empty() ? m_host : addr;
if (hst.find("http://") == 0 || hst.find("https://") == 0) {
if (hst.back() == '/') {
return (boost::format("%1%%2%") % hst % path).str();
}
else {
return (boost::format("%1%/%2%") % hst % path).str();
}
} else {
return (boost::format("http://%1%/%2%") % hst % path).str();
}
}
SL1Host::SL1Host(DynamicPrintConfig *config) : SL1Host::SL1Host(DynamicPrintConfig *config) :
OctoPrint(config), OctoPrint(config),
m_authorization_type(dynamic_cast<const ConfigOptionEnum<AuthorizationType>*>(config->option("printhost_authorization_type"))->value), m_authorization_type(dynamic_cast<const ConfigOptionEnum<AuthorizationType>*>(config->option("printhost_authorization_type"))->value),

View File

@ -44,7 +44,6 @@ private:
virtual void set_auth(Http &http) const; virtual void set_auth(Http &http) const;
std::string make_url(const std::string &path) const; std::string make_url(const std::string &path) const;
std::string make_url(const std::string& path, const std::string& addr) const;
}; };
class SL1Host: public OctoPrint class SL1Host: public OctoPrint