38 CurlStatOp(handler, url, timeout, logger, response_info, callout, header_callout),
39 m_preferred_cksum(preferred)
51 if (!rv)
return false;
53 curl_easy_setopt(
m_curl.get(), CURLOPT_NOBODY, 1L);
54 curl_easy_setopt(
m_curl.get(), CURLOPT_CUSTOMREQUEST,
nullptr);
65 curl_easy_setopt(
m_curl.get(), CURLOPT_NOBODY, 1L);
66 curl_easy_setopt(
m_curl.get(), CURLOPT_CUSTOMREQUEST,
nullptr);
73 if (
m_curl ==
nullptr)
return;
74 curl_easy_setopt(
m_curl.get(), CURLOPT_HTTPHEADER,
nullptr);
85 const auto fail = [&](uint16_t code, uint32_t errNo,
86 const std::string &message) {
95 std::array<unsigned char, XrdClHttp::g_max_checksum_length> value;
98 if (!checksums.IsSet(m_preferred_cksum)) {
100 "server did not return the requested checksum type '" +
104 value = checksums.Get(m_preferred_cksum);
105 type = m_preferred_cksum;
108 std::tie(type, value, isset) = checksums.GetFirst();
111 "server did not return a supported checksum");
115 std::stringstream ss;
117 ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(value[idx]);
122 buf->FromString(response);
virtual void OptionsDone() override
RedirectAction Redirect(std::string &target) override
void ReleaseHandle() override
CurlChecksumOp(XrdCl::ResponseHandler *handler, const std::string &url, XrdClHttp::ChecksumType preferred, struct timespec timeout, XrdCl::Log *logger, bool response_info, CreateConnCalloutType callout, HeaderCallout *header_callout)
bool Setup(CURL *curl, CurlWorker &) override
void SetDone(bool has_failed)
std::unique_ptr< ResponseInfo > MoveResponseInfo()
std::unique_ptr< CURL, void(*)(CURL *)> m_curl
std::vector< std::pair< std::string, std::string > > m_headers_list
virtual RedirectAction Redirect(std::string &target)
XrdCl::ResponseHandler * m_handler
void ReleaseHandle() override
bool Setup(CURL *curl, CurlWorker &) override
CurlStatOp(XrdCl::ResponseHandler *handler, const std::string &url, struct timespec timeout, XrdCl::Log *log, bool response_info, CreateConnCalloutType callout, HeaderCallout *header_callout)
Binary blob representation.
void Error(uint64_t topic, const char *format,...)
Report an error.
Handle an async response.
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
ConnectionCallout *(*)(const std::string &, const ResponseInfo &) CreateConnCalloutType
size_t GetChecksumLength(ChecksumType ctype)
const std::string GetTypeString(ChecksumType ctype)
const uint64_t kLogXrdClHttp
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errNotSupported
const uint16_t errCheckSumError