Implementation of get_next_finished method.
| 71 | |
| 72 | // Implementation of get_next_finished method. |
| 73 | std::unique_ptr<curl_multi::curl_message> curl_multi::get_next_finished() { |
| 74 | CURLMsg *message = curl_multi_info_read(this->curl.get(),&this->message_queued); |
| 75 | if (!message || message->msg != CURLMSG_DONE) { |
| 76 | return nullptr; |
| 77 | } |
| 78 | |
| 79 | std::unordered_map<CURL*, curl_easy*>::const_iterator it = this->handles.find(message->easy_handle); |
| 80 | if (it != this->handles.end()) { |
| 81 | return unique_ptr<curl_multi::curl_message>(new curl_multi::curl_message(message, it->second)); |
| 82 | } |
| 83 | return nullptr; |
| 84 | } |
| 85 | |
| 86 | // Implementation of perform method. |
| 87 | bool curl_multi::perform() { |