| 183 | } |
| 184 | |
| 185 | static 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 | |
| 204 | bool matchFileContent(QString &filedata, FileSwitch &s) |
| 205 | { |
no test coverage detected