XRootD
Loading...
Searching...
No Matches
XrdClS3 Namespace Reference

Classes

class  Factory
class  File
class  Filesystem

Functions

XrdCl::XRootDStatus DownloadUrl (const std::string &url, XrdClHttp::HeaderCallout *header_callout, XrdCl::ResponseHandler *handler, time_t timeout)

Variables

const uint64_t kLogXrdClS3 = 73174

Function Documentation

◆ DownloadUrl()

XrdCl::XRootDStatus XrdClS3::DownloadUrl ( const std::string & url,
XrdClHttp::HeaderCallout * header_callout,
XrdCl::ResponseHandler * handler,
time_t timeout )

Definition at line 235 of file XrdClS3DownloadHandler.cc.

236{
237 std::unique_ptr<XrdCl::File> http_file(new XrdCl::File());
238 // Hack - we need to set a few properties on the file object before the open occurs.
239 // However, the "real" (plugin) file object is not created until the open call.
240 // This forces the plugin object to be created, so we can set the properties and Open later.
241 auto status = http_file->Open(url, XrdCl::OpenFlags::Compress, XrdCl::Access::None, nullptr, time_t(0));
242 if (!status.IsOK()) {
243 return status;
244 }
245
246
247 if (header_callout) {
248 auto callout_loc = reinterpret_cast<long long>(header_callout);
249 size_t buf_size = 16;
250 char callout_buf[buf_size];
251 std::to_chars_result result = std::to_chars(callout_buf, callout_buf + buf_size - 1, callout_loc, 16);
252 if (result.ec == std::errc{}) {
253 std::string callout_str(callout_buf, result.ptr - callout_buf);
254 http_file->SetProperty("XrdClHttpHeaderCallout", callout_str);
255 }
256 }
257 http_file->SetProperty("XrdClHttpFullDownload", "true");
258
259 auto http_file_raw = http_file.get();
260 S3DownloadHandler *downloadHandler = new S3DownloadHandler(std::move(http_file), handler, timeout);
261
262 return http_file_raw->Open(url, XrdCl::OpenFlags::Read, XrdCl::Access::None, downloadHandler, timeout);
263}
A file.
Definition XrdClFile.hh:52
@ Read
Open only for reading.

References XrdCl::OpenFlags::Compress, XrdCl::Access::None, and XrdCl::OpenFlags::Read.

Referenced by XrdClS3::Filesystem::DirList().

Here is the caller graph for this function:

Variable Documentation

◆ kLogXrdClS3

const uint64_t XrdClS3::kLogXrdClS3 = 73174