| 63 | } |
| 64 | |
| 65 | TLEDownloaderTask::TLEDownloaderTask( |
| 66 | QString url, |
| 67 | QObject *parent) : Suscan::CancellableTask(parent) |
| 68 | { |
| 69 | this->multi = curl_multi_init(); |
| 70 | this->curl = curl_easy_init(); |
| 71 | |
| 72 | if (this->curl != nullptr && this->multi) { |
| 73 | // curl_easy_setopt(curl, CURLOPT_PROXY, proxy); |
| 74 | |
| 75 | curl_easy_setopt(this->curl, CURLOPT_USERAGENT, "SigDigger TLE Downloader/curl"); |
| 76 | curl_easy_setopt(this->curl, CURLOPT_CONNECTTIMEOUT, 10); |
| 77 | curl_easy_setopt(this->curl, CURLOPT_URL, url.toStdString().c_str()); |
| 78 | curl_easy_setopt(this->curl, CURLOPT_NOPROGRESS, 0); |
| 79 | curl_easy_setopt(this->curl, CURLOPT_PROGRESSFUNCTION, TLEDownloaderTask::curl_progress); |
| 80 | curl_easy_setopt(this->curl, CURLOPT_PROGRESSDATA, this); |
| 81 | curl_easy_setopt(this->curl, CURLOPT_WRITEFUNCTION, TLEDownloaderTask::curl_save_data); |
| 82 | curl_easy_setopt(this->curl, CURLOPT_WRITEDATA, this); |
| 83 | } |
| 84 | |
| 85 | curl_multi_add_handle(this->multi, this->curl); |
| 86 | |
| 87 | this->setProgress(0); |
| 88 | this->setStatus("Performing request..."); |
| 89 | |
| 90 | this->ok = true; |
| 91 | } |
| 92 | |
| 93 | void |
| 94 | TLEDownloaderTask::extractTLEs(void) |
nothing calls this directly
no test coverage detected