MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / work

Method work

Tasks/TLEDownloaderTask.cpp:112–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool
113TLEDownloaderTask::work(void)
114{
115 int running = 0;
116 bool downloadFinished = false;
117 CURLMcode mc;
118 CURLMsg *msg;
119 int left;
120
121 if (!this->ok) {
122 emit error("CURL initialization failed");
123 return false;
124 } else {
125 mc = curl_multi_perform(this->multi, &running);
126 if (running) {
127 mc = curl_multi_poll(this->multi, nullptr, 0, 1000, nullptr);
128 if (mc != CURLM_OK) {
129 emit error("CURL poll error: " + QString(curl_multi_strerror(mc)));
130 return false;
131 }
132 }
133
134 while ((msg = curl_multi_info_read(this->multi, &left)))
135 if (msg->msg == CURLMSG_DONE)
136 downloadFinished = true;
137 }
138
139 if (!running) {
140 if (!downloadFinished) {
141 emit error("Download aborted");
142 } else {
143 this->extractTLEs();
144 emit done();
145 }
146 }
147 return running != 0;
148}
149
150void
151TLEDownloaderTask::cancel(void)

Callers

nothing calls this directly

Calls 1

extractTLEsMethod · 0.95

Tested by

no test coverage detected