MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getRemoteData

Function getRemoteData

lib/legacy/switch-file.cpp:185–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185static std::string getRemoteData(std::string &url)
186{
187 std::string readBuffer;
188
189 CurlHelper::SetOpt(CURLOPT_URL, url.c_str());
190 CurlHelper::SetOpt(CURLOPT_WRITEFUNCTION, WriteCallback);
191 CurlHelper::SetOpt(CURLOPT_WRITEDATA, &readBuffer);
192
193 // Set timeout to at least one second
194 int timeout = switcher->interval / 1000;
195 if (timeout == 0) {
196 timeout = 1;
197 }
198 CurlHelper::SetOpt(CURLOPT_TIMEOUT, 1);
199 CurlHelper::Perform();
200
201 return readBuffer;
202}
203
204bool matchFileContent(QString &filedata, FileSwitch &s)
205{

Callers 1

checkRemoteFileContentFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected