275 if (m_recv_all_headers) {
276 m_recv_all_headers =
false;
277 m_recv_status_line =
false;
280 if (!m_recv_status_line) {
281 m_recv_status_line =
true;
283 std::stringstream ss(header_line);
285 if (!std::getline(ss, item,
' '))
return false;
286 m_resp_protocol = item;
287 if (!std::getline(ss, item,
' '))
return false;
289 m_status_code = std::stol(item);
293 if (m_status_code < 100 || m_status_code >= 600) {
296 if (!std::getline(ss, item,
'\n'))
return false;
297 auto cr_loc = item.find(
'\r');
298 if (cr_loc != std::string::npos) {
299 m_resp_message = item.substr(0, cr_loc);
301 m_resp_message = item;
306 if (header_line.empty() || header_line ==
"\n" || header_line ==
"\r\n") {
307 m_recv_all_headers =
true;
311 auto found = header_line.find(
":");
312 if (found == std::string::npos) {
316 std::string header_name = header_line.substr(0, found);
322 while (found < header_line.size()) {
323 if (header_line[found] !=
' ') {
break;}
326 std::string header_value = header_line.substr(found);
329 header_value.erase(header_value.find_last_not_of(
" \r\n\t") + 1);
333 auto iter = m_headers.find(header_name);
334 if (iter == m_headers.end()) {
335 m_headers.insert(iter, {header_name, {header_value}});
337 iter->second.push_back(header_value);
340 if (header_name ==
"Allow") {
341 std::string_view val(header_value);
342 while (!val.empty()) {
343 auto found = val.find(
',');
344 auto method = val.substr(0, found);
345 if (method ==
"PROPFIND") {
349 if (found == std::string_view::npos)
break;
350 val = val.substr(found + 1);
355 }
else if (header_name ==
"Content-Length") {
357 m_content_length = std::stoll(header_value);
362 else if (header_name ==
"Content-Type") {
363 std::string_view val(header_value);
364 auto found = val.find(
";");
365 auto first_type = val.substr(0, found);
366 m_multipart_byteranges = first_type ==
"multipart/byteranges";
367 if (m_multipart_byteranges) {
368 auto remainder = val.substr(found + 1);
369 found = remainder.find(
"boundary=");
370 if (found != std::string_view::npos) {
375 else if (header_name ==
"Content-Range") {
376 auto found = header_value.find(
" ");
377 if (found == std::string::npos) {
380 std::string range_unit = header_value.substr(0, found);
381 if (range_unit !=
"bytes") {
384 auto range_resp = header_value.substr(found + 1);
385 found = range_resp.find(
"/");
386 if (found == std::string::npos) {
389 auto incl_range = range_resp.substr(0, found);
390 found = incl_range.find(
"-");
391 if (found == std::string::npos) {
394 auto first_pos = incl_range.substr(0, found);
396 m_response_offset = std::stoll(first_pos);
400 auto last_pos = incl_range.substr(found + 1);
403 last_byte = std::stoll(last_pos);
407 m_content_length = last_byte - m_response_offset + 1;
409 else if (header_name ==
"Location") {
410 m_location = header_value;
411 }
else if (header_name ==
"Digest") {
414 else if (header_name ==
"Etag")
418 m_etag = header_value;
419 m_etag.erase(remove(m_etag.begin(), m_etag.end(),
'\"'), m_etag.end());
421 else if (header_name ==
"Cache-Control")
423 m_cache_control = header_value;
919 auto now = std::chrono::system_clock::now().time_since_epoch().count();
920 auto oldest_op = now;
921 auto oldest_cycle = now;
923 std::unique_lock lk(m_worker_stats_mutex);
924 for (
const auto &entry : m_workers_last_completed_cycle) {
925 if (!entry) {
continue;}
926 auto cycle = entry->load(std::memory_order_relaxed);
927 if (cycle < oldest_cycle) oldest_cycle = cycle;
929 for (
const auto &entry : m_workers_oldest_op) {
930 if (!entry) {
continue;}
931 auto op = entry->load(std::memory_order_relaxed);
932 if (op < oldest_op) oldest_op = op;
935 auto oldest_op_dbl = std::chrono::duration<double>(std::chrono::system_clock::time_point(std::chrono::system_clock::duration(oldest_op)).time_since_epoch()).count();
936 auto oldest_cycle_dbl = std::chrono::duration<double>(std::chrono::system_clock::time_point(std::chrono::system_clock::duration(oldest_cycle)).time_since_epoch()).count();
937 std::string retval =
"{"
938 "\"oldest_op\":" + std::to_string(oldest_op_dbl) +
","
939 "\"oldest_cycle\":" + std::to_string(oldest_cycle_dbl) +
","
944 for (
size_t op_idx = 0; op_idx < 402; op_idx++) {
945 if (op_idx == 401)
continue;
947 auto &op_stats = m_ops[verb_idx][op_idx];
948 auto duration = op_stats.m_duration.load(std::memory_order_relaxed);
949 if (duration == 0)
continue;
951 std::string prefix =
"http_" + verb_str +
"_" + ((op_idx == 402) ?
"invalid" : std::to_string(200 + op_idx)) +
"_";
953 auto duration_dbl = std::chrono::duration<double>(std::chrono::steady_clock::duration(duration)).count();
954 retval +=
"\"" + prefix +
"duration\":" + std::to_string(duration_dbl) +
",";
956 duration = op_stats.m_pause_duration.load(std::memory_order_relaxed);
958 duration_dbl = std::chrono::duration<double>(std::chrono::steady_clock::duration(duration)).count();
959 retval +=
"\"" + prefix +
"pause_duration\":" + std::to_string(duration_dbl) +
",";
962 auto count = op_stats.m_bytes.load(std::memory_order_relaxed);
963 if (count) retval +=
"\"" + prefix +
"bytes\":" + std::to_string(count) +
",";
964 count = op_stats.m_error.load(std::memory_order_relaxed);
965 if (count) retval +=
"\"" + prefix +
"error\":" + std::to_string(count) +
",";
966 count = op_stats.m_finished.load(std::memory_order_relaxed);
967 if (count) retval +=
"\"" + prefix +
"finished\":" + std::to_string(count) +
",";
968 count = op_stats.m_client_timeout.load(std::memory_order_relaxed);
969 if (count) retval +=
"\"" + prefix +
"client_timeout\":" + std::to_string(count) +
",";
970 count = op_stats.m_server_timeout.load(std::memory_order_relaxed);
971 if (count) retval +=
"\"" + prefix +
"server_timeout\":" + std::to_string(count) +
",";
974 auto &op_stats = m_ops[verb_idx][401];
975 auto duration = op_stats.m_duration.load(std::memory_order_relaxed);
976 if (duration == 0)
continue;
978 std::string prefix =
"http_" + verb_str +
"_";
980 auto duration_dbl = std::chrono::duration<double>(std::chrono::steady_clock::duration(duration)).count();
981 retval +=
"\"" + prefix +
"preheader_duration\":" + std::to_string(duration_dbl) +
",";
983 auto count = op_stats.m_started.load(std::memory_order_relaxed);
984 if (count) retval +=
"\"" + prefix +
"started\":" + std::to_string(count) +
",";
985 count = op_stats.m_error.load(std::memory_order_relaxed);
986 if (count) retval +=
"\"" + prefix +
"preheader_error\":" + std::to_string(count) +
",";
987 count = op_stats.m_finished.load(std::memory_order_relaxed);
988 if (count) retval +=
"\"" + prefix +
"preheader_finished\":" + std::to_string(count) +
",";
989 count = op_stats.m_server_timeout.load(std::memory_order_relaxed);
990 if (count) retval +=
"\"" + prefix +
"preheader_timeout\":" + std::to_string(count) +
",";
991 count = op_stats.m_conncall_timeout.load(std::memory_order_relaxed);
992 if (count) retval +=
"\"" + prefix +
"conncall_timeout\":" + std::to_string(count) +
",";
997 "\"conncall_error\":" + std::to_string(m_conncall_errors.load(std::memory_order_relaxed)) +
","
998 "\"conncall_started\":" + std::to_string(m_conncall_req.load(std::memory_order_relaxed)) +
","
999 "\"conncall_success\":" + std::to_string(m_conncall_success.load(std::memory_order_relaxed)) +
","
1000 "\"conncall_timeout\":" + std::to_string(m_conncall_timeout.load(std::memory_order_relaxed)) +
1087 int max_pending = 50;
1090 auto &queue = *m_queue.get();
1093 CURLM *multi_handle = curl_multi_init();
1094 if (multi_handle ==
nullptr) {
1095 throw std::runtime_error(
"Failed to create curl multi-handle");
1098 int running_handles = 0;
1099 time_t last_maintenance = time(NULL);
1100 CURLMcode mres = CURLM_OK;
1104 std::unordered_map<int, WaitingForBroker> broker_reqs;
1105 std::vector<struct curl_waitfd> waitfds;
1107 bool want_shutdown =
false;
1108 while (!want_shutdown) {
1109 m_last_completed_cycle.store(std::chrono::system_clock::now().time_since_epoch().count());
1110 auto oldest_op = std::chrono::system_clock::now();
1111 for (
const auto &entry : m_op_map) {
1112 OpRecord(*entry.second.first, OpKind::Update);
1113 if (entry.second.second < oldest_op) {
1114 oldest_op = entry.second.second;
1117 m_oldest_op.store(oldest_op.time_since_epoch().count());
1121 auto op = m_continue_queue->TryConsume();
1128 m_logger->Debug(
kLogXrdClHttp,
"Ignoring continuation of operation that has already completed");
1131 m_logger->Debug(
kLogXrdClHttp,
"Continuing the curl handle from op %p on thread %d", op.get(), getthreadid());
1135 OpRecord(*op, OpKind::Error);
1138 curl_multi_remove_handle(multi_handle, curl);
1139 curl_easy_cleanup(curl);
1140 m_op_map.erase(curl);
1142 running_handles -= 1;
1145 auto iter = m_op_map.find(curl);
1146 if (iter != m_op_map.end()) iter->second.second = std::chrono::system_clock::now();
1150 while (running_handles <
static_cast<int>(m_max_ops)) {
1151 auto op = running_handles == 0 ? queue.Consume(std::chrono::seconds(1)) : queue.TryConsume();
1155 auto curl = queue.GetHandle();
1156 if (curl ==
nullptr) {
1157 m_logger->Debug(
kLogXrdClHttp,
"Unable to allocate a curl handle");
1162 auto rv = op->
Setup(curl, *
this);
1164 m_logger->Debug(
kLogXrdClHttp,
"Failed to setup the curl handle");
1169 m_logger->Debug(
kLogXrdClHttp,
"Failed to finish setup of the curl handle");
1174 m_logger->Debug(
kLogXrdClHttp,
"Unable to setup the curl handle");
1183 m_op_map[curl] = {op, std::chrono::system_clock::now()};
1188 std::string modified_url;
1189 std::shared_ptr<CurlOptionsOp> options_op(
1201 curl = queue.GetHandle();
1202 if (curl ==
nullptr) {
1203 m_logger->Debug(
kLogXrdClHttp,
"Unable to allocate a curl handle");
1205 OpRecord(*op, OpKind::Error);
1208 auto rv = options_op->Setup(curl, *
this);
1210 m_logger->Debug(
kLogXrdClHttp,
"Failed to allocate a curl handle for OPTIONS");
1213 m_op_map[curl] = {options_op, std::chrono::system_clock::now()};
1214 OpRecord(*options_op, OpKind::Start);
1215 running_handles += 1;
1217 OpRecord(*op, OpKind::Start);
1220 auto mres = curl_multi_add_handle(multi_handle, curl);
1221 if (mres != CURLM_OK) {
1222 m_logger->Debug(
kLogXrdClHttp,
"Unable to add operation to the curl multi-handle");
1224 OpRecord(*op, OpKind::Error);
1227 m_logger->Debug(
kLogXrdClHttp,
"Added request for URL %s to worker thread for processing", op->
GetUrl().c_str());
1228 running_handles += 1;
1233 time_t now = time(NULL);
1234 time_t next_maintenance = last_maintenance + m_maintenance_period.load(std::memory_order_relaxed);
1235 if (now >= next_maintenance) {
1237 m_continue_queue->Expire();
1238 m_logger->Debug(
kLogXrdClHttp,
"Curl worker thread %d is running %d operations",
1239 getthreadid(), running_handles);
1240 last_maintenance = now;
1243 std::vector<std::pair<int, CURL *>> expired_ops;
1244 for (
const auto &entry : broker_reqs) {
1245 if (entry.second.expiry < now) {
1246 expired_ops.emplace_back(entry.first, entry.second.curl);
1249 for (
const auto &entry : expired_ops) {
1250 auto iter = m_op_map.find(entry.second);
1251 if (iter == m_op_map.end()) {
1252 m_logger->Warning(
kLogXrdClHttp,
"Found an expired curl handle with no corresponding operation!");
1256 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(iter->second.first.get())) !=
nullptr) {
1258 bool parent_op_failed =
false;
1259 if (parent_op->IsRedirect()) {
1263 if (iter != m_op_map.end()) {
1264 OpRecord(*iter->second.first, OpKind::Error);
1266 m_op_map.erase(iter);
1267 running_handles -= 1;
1269 parent_op_failed =
true;
1271 OpRecord(*parent_op, OpKind::Start);
1274 OpRecord(*parent_op, OpKind::Start);
1276 if (!parent_op_failed){
1282 iter->second.first->ReleaseHandle();
1283 OpRecord(*(iter->second.first), OpKind::ConncallTimeout);
1284 m_op_map.erase(entry.second);
1285 curl_easy_cleanup(entry.second);
1286 running_handles -= 1;
1288 broker_reqs.erase(entry.first);
1289 m_conncall_timeout.fetch_add(1, std::memory_order_relaxed);
1297 waitfds.resize(3 + broker_reqs.size());
1299 waitfds[0].fd = queue.PollFD();
1300 waitfds[0].events = CURL_WAIT_POLLIN;
1301 waitfds[0].revents = 0;
1302 waitfds[1].fd = m_continue_queue->PollFD();
1303 waitfds[1].events = CURL_WAIT_POLLIN;
1304 waitfds[1].revents = 0;
1305 waitfds[2].fd = m_shutdown_pipe_r;
1306 waitfds[2].revents = 0;
1307 waitfds[2].events = CURL_WAIT_POLLIN | CURL_WAIT_POLLPRI;
1310 for (
const auto &entry : broker_reqs) {
1311 waitfds[idx].fd = entry.first;
1312 waitfds[idx].events = CURL_WAIT_POLLIN|CURL_WAIT_POLLPRI;
1313 waitfds[idx].revents = 0;
1318 curl_multi_timeout(multi_handle, &timeo);
1322 if (running_handles && timeo == -1) {
1327 mres = curl_multi_wait(multi_handle, &waitfds[0], waitfds.size(), 50,
nullptr);
1333 mres = curl_multi_wait(multi_handle, &waitfds[0], waitfds.size(), 50,
nullptr);
1335 if (mres != CURLM_OK) {
1336 m_logger->Warning(
kLogXrdClHttp,
"Failed to wait on multi-handle: %d", mres);
1340 for (
const auto &entry : waitfds) {
1342 if (waitfds[0].fd == entry.fd || waitfds[1].fd == entry.fd) {
1346 if ((waitfds[2].fd == entry.fd) && entry.revents) {
1347 want_shutdown =
true;
1350 if ((entry.revents & CURL_WAIT_POLLIN) != CURL_WAIT_POLLIN) {
1353 auto handle = broker_reqs[entry.fd].curl;
1354 auto iter = m_op_map.find(handle);
1355 if (iter == m_op_map.end()) {
1356 m_logger->Warning(
kLogXrdClHttp,
"Internal error: broker responded on FD %d but no corresponding curl operation", entry.fd);
1357 broker_reqs.erase(entry.fd);
1358 m_conncall_errors.fetch_add(1, std::memory_order_relaxed);
1362 auto result = iter->second.first->WaitSocketCallback(err);
1364 m_logger->Warning(
kLogXrdClHttp,
"Error when invoking the broker callback: %s", err.c_str());
1367 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(iter->second.first.get())) !=
nullptr) {
1369 bool parent_op_failed =
false;
1370 if (parent_op->IsRedirect()) {
1374 if (iter != m_op_map.end()) {
1375 OpRecord(*iter->second.first, OpKind::Error);
1377 m_op_map.erase(iter);
1378 running_handles -= 1;
1380 parent_op_failed =
true;
1382 OpRecord(*parent_op, OpKind::Start);
1385 OpRecord(*parent_op, OpKind::Start);
1387 if (!parent_op_failed){
1393 OpRecord(*iter->second.first, OpKind::Error);
1394 m_op_map.erase(handle);
1395 broker_reqs.erase(entry.fd);
1396 m_conncall_errors.fetch_add(1, std::memory_order_relaxed);
1397 running_handles -= 1;
1399 broker_reqs.erase(entry.fd);
1400 curl_multi_add_handle(multi_handle, handle);
1401 m_conncall_success.fetch_add(1, std::memory_order_relaxed);
1407 auto mres = curl_multi_perform(multi_handle, &still_running);
1408 if (mres == CURLM_CALL_MULTI_PERFORM) {
1410 }
else if (mres != CURLM_OK) {
1411 m_logger->Warning(
kLogXrdClHttp,
"Failed to perform multi-handle operation: %d", mres);
1418 msg = curl_multi_info_read(multi_handle, &msgq);
1419 if (msg && (msg->msg == CURLMSG_DONE)) {
1420 if (!msg->easy_handle) {
1421 m_logger->Warning(
kLogXrdClHttp,
"Logic error: got a callback for a null handle");
1422 mres = CURLM_BAD_EASY_HANDLE;
1425 auto iter = m_op_map.find(msg->easy_handle);
1426 if (iter == m_op_map.end()) {
1427 m_logger->Error(
kLogXrdClHttp,
"Logic error: got a callback for an entry that doesn't exist");
1428 mres = CURLM_BAD_EASY_HANDLE;
1431 auto op = iter->second.first;
1432 auto res = msg->data.result;
1433 bool keep_handle =
false;
1434 bool waiting_on_callout =
false;
1435 if (res == CURLE_OK) {
1437 OpRecord(*op, OpKind::Finish);
1446 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(op.get())) !=
nullptr) {
1448 bool parent_op_failed =
false;
1449 if (parent_op->IsRedirect()) {
1452 OpRecord(*parent_op, OpKind::Error);
1454 running_handles -= 1;
1455 parent_op_failed =
true;
1457 OpRecord(*parent_op, OpKind::Start);
1460 OpRecord(*parent_op, OpKind::Start);
1463 if (!parent_op_failed) {
1468 queue.RecycleHandle(iter->first);
1472 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(op.get()))) {
1478 OpRecord(*op, OpKind::Start);
1480 curl_multi_remove_handle(multi_handle, iter->first);
1481 queue.RecycleHandle(iter->first);
1496 OpRecord(*op, OpKind::Error);
1498 keep_handle =
false;
1506 OpRecord(*op, OpKind::Start);
1516 std::string modified_url;
1519 std::shared_ptr<CurlOperation> new_op(options_op);
1520 auto curl = queue.GetHandle();
1521 if (curl ==
nullptr) {
1522 m_logger->Debug(
kLogXrdClHttp,
"Unable to allocate a curl handle");
1524 keep_handle =
false;
1525 options_op =
nullptr;
1528 OpRecord(*new_op, OpKind::Start);
1530 auto rv = new_op->Setup(curl, *
this);
1532 m_logger->Debug(
kLogXrdClHttp,
"Unable to configure a curl handle for OPTIONS");
1533 keep_handle =
false;
1534 options_op =
nullptr;
1538 m_logger->Debug(
kLogXrdClHttp,
"Unable to setup the curl handle for the OPTIONS operation");
1539 new_op->Fail(
XrdCl::errInternal, ENOMEM,
"Failed to setup the curl handle for the OPTIONS operation");
1540 OpRecord(*new_op, OpKind::Error);
1541 keep_handle =
false;
1544 new_op->SetContinueQueue(m_continue_queue);
1545 m_op_map[curl] = {new_op, std::chrono::system_clock::now()};
1546 auto mres = curl_multi_add_handle(multi_handle, curl);
1547 if (mres != CURLM_OK) {
1548 m_logger->Debug(
kLogXrdClHttp,
"Unable to add OPTIONS operation to the curl multi-handle: %s", curl_multi_strerror(mres));
1550 OpRecord(*new_op, OpKind::Error);
1553 running_handles += 1;
1554 m_logger->Debug(
kLogXrdClHttp,
"Invoking the OPTIONS operation before redirect to %s", target.c_str());
1561 if ((waiting_on_callout = callout_socket >= 0)) {
1562 auto expiry = time(
nullptr) + 20;
1563 m_logger->Debug(
kLogXrdClHttp,
"Creating a callout wait request on socket %d", callout_socket);
1564 broker_reqs[callout_socket] = {iter->first, expiry};
1565 m_conncall_req.fetch_add(1, std::memory_order_relaxed);
1567 }
else if (options_op) {
1572 curl_multi_remove_handle(multi_handle, iter->first);
1573 if (!waiting_on_callout && !options_op) {
1574 curl_multi_add_handle(multi_handle, iter->first);
1576 }
else if (!options_op) {
1580 queue.RecycleHandle(iter->first);
1589 int wait_socket = -1;
1591 m_logger->Error(
kLogXrdClHttp,
"Failed to start broker-based connection: %s", err.c_str());
1593 keep_handle =
false;
1595 curl_multi_remove_handle(multi_handle, iter->first);
1596 auto expiry = time(
nullptr) + 20;
1597 m_logger->Debug(
kLogXrdClHttp,
"Curl operation requires a new TCP socket; waiting for callout to respond on socket %d", wait_socket);
1598 broker_reqs[wait_socket] = {iter->first, expiry};
1599 m_conncall_req.fetch_add(1, std::memory_order_relaxed);
1602 if (res == CURLE_ABORTED_BY_CALLBACK || res == CURLE_WRITE_ERROR) {
1607#ifdef HAVE_XPROTOCOL_TIMEREXPIRED
1612 OpRecord(*op, OpKind::Error);
1617 OpRecord(*op, OpKind::Error);
1622 OpRecord(*op, op->
IsPaused() ? OpKind::ClientTimeout : OpKind::ServerTimeout);
1626 OpRecord(*op, OpKind::ServerTimeout);
1630 OpRecord(*op, OpKind::ClientTimeout);
1634 OpRecord(*op, OpKind::ServerTimeout);
1638 OpRecord(*op, OpKind::Error);
1642 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(op.get())) !=
nullptr) {
1644 bool parent_op_failed =
false;
1645 if (parent_op->IsRedirect()) {
1649 if (iter != m_op_map.end()) {
1650 OpRecord(*iter->second.first, OpKind::Error);
1652 m_op_map.erase(iter);
1653 running_handles -= 1;
1655 parent_op_failed =
true;
1657 OpRecord(*parent_op, OpKind::Start);
1660 OpRecord(*parent_op, OpKind::Start);
1662 if (!parent_op_failed){
1669 const char *curl_easy_err = curl_easy_strerror(res);
1670 const std::string fail_err = !curl_err.empty() ? curl_err : curl_easy_err;
1671 m_logger->Debug(
kLogXrdClHttp,
"Curl generated an error: %s (%d)", fail_err.c_str(), res);
1672 op->
Fail(xrdCode.first, xrdCode.second, fail_err);
1673 OpRecord(*op, OpKind::Error);
1675 if ((options_op =
dynamic_cast<CurlOptionsOp*
>(op.get())) !=
nullptr) {
1677 bool parent_op_failed =
false;
1678 if (parent_op->IsRedirect()) {
1682 if (iter != m_op_map.end()) {
1683 OpRecord(*iter->second.first, OpKind::Error);
1685 m_op_map.erase(iter);
1686 running_handles -= 1;
1688 parent_op_failed =
true;
1691 if (!parent_op_failed){
1699 curl_multi_remove_handle(multi_handle, iter->first);
1700 if (res != CURLE_OK) {
1701 curl_easy_cleanup(iter->first);
1703 for (
auto &req : broker_reqs) {
1704 if (req.second.curl == iter->first) {
1705 m_logger->Warning(
kLogXrdClHttp,
"Curl handle finished while a broker operation was outstanding");
1706 m_conncall_errors.fetch_add(1, std::memory_order_relaxed);
1709 m_op_map.erase(iter);
1710 running_handles -= 1;
1716 for (
auto map_entry : m_op_map) {
1719 OpRecord(*map_entry.second.first, OpKind::Error);
1721 if (multi_handle && map_entry.first) curl_multi_remove_handle(multi_handle, map_entry.first);
1724 m_queue->ReleaseHandles();
1725 curl_multi_cleanup(multi_handle);