Revert "wsd: add fetch external method"

This reverts commit 19ed2aa2b4.

Change-Id: I6b6762c0a7bf74dd358fcb7a4239abc37c92bd18
Signed-off-by: Henry Castro <hcastro@collabora.com>
This commit is contained in:
Henry Castro 2022-06-22 11:33:20 -04:00 committed by Michael Meeks
parent df1ce42fa3
commit 39586d1631
3 changed files with 0 additions and 48 deletions

View file

@ -2411,9 +2411,6 @@ void COOLWSD::innerInitialize(Application& self)
<< getServiceURI("/hosting/discovery") << '\n';
std::cerr << std::endl;
#else
// ---------------- from here on we start getting external messages ----------------
FileServerRequestHandler::fetchExternal();
#endif
#endif

View file

@ -58,10 +58,6 @@ using Poco::Net::HTTPResponse;
using Poco::Net::NameValueCollection;
using Poco::Util::Application;
#define DEFAULT_LOGO "https://www.collaboraoffice.com/downloads/images/lokit-extra-img.svg"
std::string FileServerRequestHandler::LogoData;
std::map<std::string, std::pair<std::string, std::string>> FileServerRequestHandler::FileHash;
namespace {
@ -815,43 +811,6 @@ void FileServerRequestHandler::initialize()
}
}
void FileServerRequestHandler::fetchExternal()
{
try {
Poco::URI uriLogo(DEFAULT_LOGO);
auto sessionLogo = http::Session::create(uriLogo.getHost(),
http::Session::Protocol::HttpSsl,
uriLogo.getPort());
sessionLogo->setTimeout(std::chrono::seconds(10));
http::Request requestLogo(uriLogo.getPathAndQuery());
http::Session::FinishedCallback logoCallback =
[](const std::shared_ptr<http::Session>& httpSession)
{
const std::shared_ptr<const http::Response> httpResponse = httpSession->response();
if (httpResponse->statusLine().statusCode() == Poco::Net::HTTPResponse::HTTP_OK)
{
LogoData = httpResponse->getBody();
}
};
sessionLogo->setFinishedHandler(logoCallback);
sessionLogo->asyncRequest(requestLogo, *COOLWSD::getWebServerPoll());
}
catch(const Poco::Exception& exc)
{
LOG_DBG("Fetch External: " << exc.displayText());
}
catch(std::exception& exc)
{
LOG_DBG("Fetch External: " << exc.what());
}
catch(...)
{
LOG_DBG("Fetch External: Unknown exception");
}
}
const std::string *FileServerRequestHandler::getCompressedFile(const std::string &path)
{
return &FileHash[path].second;

View file

@ -62,10 +62,6 @@ public:
static void readDirToHash(const std::string &basePath, const std::string &path, const std::string &prefix = std::string());
static void fetchExternal();
static std::string LogoData;
static const std::string *getCompressedFile(const std::string &path);
static const std::string *getUncompressedFile(const std::string &path);