implement cloud browser

This commit is contained in:
2017-11-05 22:54:04 +00:00
parent ae7a8948b7
commit 11c26555a4
19 changed files with 434 additions and 73 deletions

View File

@@ -4,13 +4,6 @@
LogRemote LogRemote::I;
static size_t data_handler(void *contents, size_t size, size_t nmemb, void *userp)
{
auto buffer = reinterpret_cast<std::string*>(userp);
buffer->append((char*)contents, size * nmemb);
return size * nmemb;
}
void LogRemote::start()
{
if (m_running || m_error)
@@ -43,7 +36,7 @@ void LogRemote::net_init()
return;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &this->readBuffer);
//curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, data_handler);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L);
}
std::string LogRemote::net_request(std::string cmd, std::string data /*= ""*/)