MCPcopy Create free account
hub / github.com/RetroShare/RetroShare / downloadText

Method downloadText

plugins/FeedReader/util/CURLWrapper.cpp:58–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58CURLcode CURLWrapper::downloadText(const std::string &link, std::string &data)
59{
60 data.clear();
61
62 if (!mCurl) {
63 return CURLE_FAILED_INIT;
64 }
65
66 curl_easy_setopt(mCurl, CURLOPT_URL, link.c_str());
67 curl_easy_setopt(mCurl, CURLOPT_WRITEFUNCTION, writeFunctionString);
68 curl_easy_setopt(mCurl, CURLOPT_WRITEDATA, &data);
69 curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, false);
70 curl_easy_setopt(mCurl, CURLOPT_USERAGENT, USERAGENT);
71
72 return curl_easy_perform(mCurl);
73}
74
75static size_t writeFunctionBinary (void *ptr, size_t size, size_t nmemb, void *stream)
76{

Callers 2

downloadMethod · 0.80
processMsgMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected