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

@@ -63,13 +63,6 @@ void App::initLog()
LogRemote::I.file_init();
}
static size_t curl_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 App::upload(std::string filename)
{
CURL *curl;
@@ -94,7 +87,7 @@ void App::upload(std::string filename)
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &res);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);
auto err = curl_easy_perform(curl); //here it crashes
auto err = curl_easy_perform(curl);
std::cout << "\n\nUPLOAD RESULT\n" << res << "\n\n\n";
curl_easy_cleanup(curl);
}