Rename XLXHostFileDownloader => HostFileDownloader #50

develop
Geoffrey Merck 1 year ago
parent 548aa9f803
commit 8842e8b834

@ -20,17 +20,17 @@
#include <cstdio>
#include <curl/curl.h>
#include "XLXHostsFileDownloader.h"
#include "HostsFileDownloader.h"
#include "Log.h"
size_t CXLXHostsFileDownloader::write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
size_t CHostsFileDownloader::write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t written = fwrite(ptr, size, nmemb, stream);
return written;
}
/* wxHTTP randomly crashes when called on a worker thread, this must be called from main thread ! */
std::string CXLXHostsFileDownloader::download(const std::string & xlxHostsFileURL)
std::string CHostsFileDownloader::download(const std::string & xlxHostsFileURL)
{
CURL *curl;
FILE *fp;

@ -21,7 +21,7 @@
#include <string>
class CXLXHostsFileDownloader {
class CHostsFileDownloader {
public:
static std::string download(const std::string & xlxHostsFileURL);
private:

@ -343,7 +343,7 @@ bool CDStarGatewayApp::createThread()
TXLX xlxConfig;
m_config->getXLX(xlxConfig);
CLog::logInfo("XLX enabled: %d, Hosts file url: %s", int(xlxConfig.enabled), xlxConfig.url.c_str());
m_thread->setXLX(xlxConfig.enabled, xlxConfig.enabled ? CXLXHostsFileDownloader::download(xlxConfig.url) : "");
m_thread->setXLX(xlxConfig.enabled, xlxConfig.enabled ? CHostsFileDownloader::download(xlxConfig.url) : "");
// Setup Remote
TRemote remoteConfig;

Loading…
Cancel
Save

Powered by TurnKey Linux.