| 812 | } |
| 813 | |
| 814 | void CURLConnection::updateSource(const string &location) |
| 815 | { |
| 816 | curl_easy_setopt(mHttp_handle, CURLOPT_URL, location.c_str()); |
| 817 | mFileSize = -1; |
| 818 | uri = location; |
| 819 | |
| 820 | if (reSolveList) { |
| 821 | curl_slist_free_all(reSolveList); |
| 822 | } |
| 823 | |
| 824 | CURLSH *sh = nullptr; |
| 825 | reSolveList = CURLShareInstance::Instance()->getHosts(uri, &sh); |
| 826 | assert(sh != nullptr); |
| 827 | curl_easy_setopt(mHttp_handle, CURLOPT_SHARE, sh); |
| 828 | |
| 829 | if (reSolveList != nullptr) { |
| 830 | curl_easy_setopt(mHttp_handle, CURLOPT_RESOLVE, reSolveList); |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | void CURLConnection::updateHeaderList(struct curl_slist *headerList) |
| 835 | { |