5 #ifndef CVMFS_NETWORK_S3FANOUT_H_
6 #define CVMFS_NETWORK_S3FANOUT_H_
60 texts[1] =
"S3: local I/O failure";
61 texts[2] =
"S3: malformed URL (bad request)";
62 texts[3] =
"S3: forbidden";
63 texts[4] =
"S3: failed to resolve host address";
64 texts[5] =
"S3: host connection problem";
65 texts[6] =
"S3: not found";
66 texts[7] =
"S3: service not available";
67 texts[8] =
"S3: unknown service error, perhaps wrong authentication protocol";
68 texts[8] =
"S3: too many requests, service asks for backoff and retry";
90 std::string
Print()
const;
117 : object_key(object_key),
135 reinterpret_cast<char *
>(smalloc(
sizeof(
char) * CURL_ERROR_SIZE));
235 void *userp,
void *socketp);
245 std::string remote_host)
const;
247 curl_slist *clist)
const;
256 std::string
GetUriEncode(
const std::string &val,
bool encode_slash)
const;
260 std::vector<std::string> *headers)
const;
262 std::vector<std::string> *headers)
const;
264 std::vector<std::string> *headers)
const;
265 std::string
MkUrl(
const std::string &objkey)
const {
346 #endif // CVMFS_NETWORK_S3FANOUT_H_
pthread_mutex_t * jobs_todo_lock_
std::string GetAwsV4SigningKey(const std::string &date) const
atomic_int32 multi_threaded_
AuthzMethods authz_method
std::string GetContentType(const JobInfo &info) const
pthread_mutex_t * curl_handle_lock_
std::set< CURL * > * pool_handles_idle_
struct curl_slist * http_headers
dns::CaresResolver * resolver_
static const unsigned kDefault429ThrottleMs
static const char * kCacheControlDotCvmfs
bool MkV2Authz(const JobInfo &info, std::vector< std::string > *headers) const
S3FanoutManager(const S3Config &config)
static void * MainUpload(void *data)
const std::string object_key
std::string MkCompleteHostname()
void PushNewJob(JobInfo *info)
static const char * kCacheControlCas
std::string GetRequestString(const JobInfo &info) const
std::string hostname_port
void InitializeDnsSettingsCurl(CURL *handle, CURLSH *sharehandle, curl_slist *clist) const
SynchronizingCounter< uint32_t > Semaphore
std::string Print() const
int InitializeDnsSettings(CURL *handle, std::string remote_host) const
struct curl_slist * clist
std::string * user_agent_
unsigned int max_available_jobs_
bool MkPayloadHash(const JobInfo &info, std::string *hex_hash) const
std::set< JobInfo * > * active_requests_
void PushCompletedJob(JobInfo *info)
void UpdateStatistics(CURL *handle)
std::string MkUrl(const std::string &objkey) const
void SetUrlOptions(JobInfo *info) const
CURL * AcquireCurlHandle() const
static const unsigned kDefaultHTTPSPort
uint64_t throttle_timestamp
Semaphore * available_jobs_
static int CallbackCurlSocket(CURL *easy, curl_socket_t s, int action, void *userp, void *socketp)
unsigned opt_backoff_max_ms
UniquePtr< FileBackedBuffer > origin
JobInfo(const std::string &object_key, void *callback, FileBackedBuffer *origin)
void ReleaseCurlHandle(JobInfo *info, CURL *handle) const
void Backoff(JobInfo *info)
uint32_t pool_max_handles
struct pollfd * watch_fds_
JobInfo * PopCompletedJob()
unsigned opt_backoff_init_ms
static const unsigned kMax429ThrottleMs
uint32_t watch_fds_inuse_
unsigned char num_retries
std::string complete_hostname_
bool MkAzureAuthz(const JobInfo &info, std::vector< std::string > *headers) const
static const unsigned kLowSpeedLimit
static const unsigned kDefaultHTTPPort
bool VerifyAndFinalize(const int curl_error, JobInfo *info)
static void DetectThrottleIndicator(const std::string &header, JobInfo *info)
std::set< S3FanOutDnsEntry * > * sharehandles_
SslCertificateStore ssl_certificate_store_
static const unsigned kThrottleReportIntervalSec
const Statistics & GetStatistics()
std::pair< std::string, std::string > last_signing_key_
std::string GetUriEncode(const std::string &val, bool encode_slash) const
bool MkV4Authz(const JobInfo &info, std::vector< std::string > *headers) const
uint64_t timestamp_last_throttle_report_
std::set< CURL * > * pool_handles_inuse_
std::map< CURL *, S3FanOutDnsEntry * > * curl_sharehandles_
std::vector< s3fanout::JobInfo * > jobs_todo_
bool CanRetry(const JobInfo *info)
const char * Code2Ascii(const Failures error)
Failures InitializeRequest(JobInfo *info, CURL *handle) const