159 CURLcode
perform(CURL* handle);
220 std::string
prepareLogMessage(std::string host_url, std::string userAgent,
const std::string&
path,
long ts,
const std::map<std::string, std::string>* headers,
long httpCode)
const;
225 std::string
trimHostUrl(std::string full_host_url)
const;
231 std::string prepareRedirectedURL(std::string
address, std::string potentialHost)
const;
239 std::vector<std::string> getLocations(std::multimap<std::string, std::string>* headerMap)
const;
241 std::string mUserAgentId =
"CCDBDownloader";
245 void setupInternalUVLoop();
250 int mHandlesInUse = 0;
255 CURLM* mCurlMultiHandle =
nullptr;
265 std::vector<CURL*> mHandlesToBeAdded;
278 typedef struct curl_context_s {
280 curl_socket_t sockfd = -1;
287 typedef struct DataForSocket {
292 DataForSocket mSocketData;
294#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
298 typedef struct PerformData {
299 CURLcode* codeDestination;
300 size_t* requestsLeft;
304 DownloaderRequestData* requestData;
305 curl_slist** options;
315 static void closesocketCallback(
void* clientp, curl_socket_t item);
317#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
319 std::string getNewLocation(PerformData* performData, std::vector<std::string>&
locations)
const;
322 void tryNewHost(PerformData* performData, CURL* easy_handle);
325 void getLocalContent(PerformData* performData, std::string& newLocation,
bool& contentRetrieved, std::vector<std::string>&
locations);
328 void httpRedirect(PerformData* performData, std::string& newLocation, CURL* easy_handle);
331 void followRedirect(PerformData* performData, CURL* easy_handle, std::vector<std::string>&
locations,
bool& rescheduled,
bool& contentRetrieved);
341 static void curlPerform(
uv_poll_t* handle,
int status,
int events);
346 static int handleSocket(CURL* easy, curl_socket_t s,
int action,
void* userp,
void* socketp);
353 static void closeSocketByTimer(
uv_timer_t* handle);
374 static void destroyCurlContext(curl_context_t* context);
383 static int startTimeout(CURLM* multi,
long timeout_ms,
void* userp);
388 void initializeMultiHandle();
396 void transferFinished(CURL* handle, CURLcode curlCode);
401 void checkMultiInfo();
403#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
407 void setHandleOptions(CURL* handle, PerformData*
data);
415 curl_context_t* createCurlContext(curl_socket_t sockfd);
420 void checkHandleQueue();
std::string prepareLogMessage(std::string host_url, std::string userAgent, const std::string &path, long ts, const std::map< std::string, std::string > *headers, long httpCode) const