165 CURLcode
perform(CURL* handle);
226 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;
231 std::string
trimHostUrl(std::string full_host_url)
const;
237 std::string prepareRedirectedURL(std::string
address, std::string potentialHost)
const;
246 void updateLocations(std::multimap<std::string, std::string>* headerMap, std::vector<std::string>*
locations,
int* locIndex)
const;
248 std::string mUserAgentId =
"CCDBDownloader";
252 void setupInternalUVLoop();
257 int mHandlesInUse = 0;
262 CURLM* mCurlMultiHandle =
nullptr;
272 std::vector<CURL*> mHandlesToBeAdded;
285 typedef struct curl_context_s {
287 curl_socket_t sockfd = -1;
294 typedef struct DataForSocket {
299 DataForSocket mSocketData;
301#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
305 typedef struct PerformData {
306 CURLcode* codeDestination;
307 size_t* requestsLeft;
311 DownloaderRequestData* requestData;
313 std::vector<curl_slist*>* options;
323 static void closesocketCallback(
void* clientp, curl_socket_t item);
325#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
327 std::string getNewLocation(PerformData* performData, std::vector<std::string>&
locations)
const;
330 void tryNewHost(PerformData* performData, CURL* easy_handle);
333 void getLocalContent(PerformData* performData, std::string& newLocation,
bool& contentRetrieved, std::vector<std::string>&
locations);
336 void httpRedirect(PerformData* performData, std::string& newLocation, CURL* easy_handle);
339 void followRedirect(PerformData* performData, CURL* easy_handle, std::vector<std::string>&
locations,
bool& rescheduled,
bool& contentRetrieved);
349 static void curlPerform(
uv_poll_t* handle,
int status,
int events);
354 static int handleSocket(CURL* easy, curl_socket_t s,
int action,
void* userp,
void* socketp);
361 static void closeSocketByTimer(
uv_timer_t* handle);
382 static void destroyCurlContext(curl_context_t* context);
391 static int startTimeout(CURLM* multi,
long timeout_ms,
void* userp);
396 void initializeMultiHandle();
404 void transferFinished(CURL* handle, CURLcode curlCode);
409 void checkMultiInfo();
411#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
415 void setHandleOptions(CURL* handle, PerformData*
data);
423 curl_context_t* createCurlContext(curl_socket_t sockfd);
428 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