CernVM-FS  2.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
jobinfo.cc
Go to the documentation of this file.
1 
5 #include "jobinfo.h"
6 
7 #include "util/string.h"
8 
9 namespace download {
10 
12 
13 JobInfo::JobInfo(const std::string *u, const bool c, const bool ph,
14  const shash::Any *h, cvmfs::Sink *s) {
15  Init();
16 
17  url_ = u;
18  compressed_ = c;
19  probe_hosts_ = ph;
20  expected_hash_ = h;
21  sink_ = s;
22 }
23 
24 JobInfo::JobInfo(const std::string *u, const bool ph) {
25  Init();
26 
27  url_ = u;
28  probe_hosts_ = ph;
29  head_request_ = true;
30 }
31 
32 
34  if (HasPrefix(*url_, "file://", true /* ignore_case */))
36 
37  return http_code_ == 404;
38 }
39 
40 void JobInfo::Init() {
41  id_ = atomic_xadd64(&next_uuid, 1);
42  pipe_job_results = NULL;
43  url_ = NULL;
44  compressed_ = false;
45  probe_hosts_ = false;
46  head_request_ = false;
47  follow_redirects_ = false;
48  force_nocache_ = false;
49  pid_ = -1;
50  uid_ = -1;
51  gid_ = -1;
52  cred_data_ = NULL;
53  interrupt_cue_ = NULL;
54  sink_ = NULL;
55  expected_hash_ = NULL;
56  extra_info_ = NULL;
57  //
58  range_offset_ = -1;
59  range_size_ = -1;
60  //
61  curl_handle_ = NULL;
62  headers_ = NULL;
63  info_header_ = NULL;
64  tracing_header_pid_ = NULL;
65  tracing_header_gid_ = NULL;
66  tracing_header_uid_ = NULL;
67  nocache_ = false;
69  http_code_ = -1;
70  link_ = "";
73  num_used_hosts_ = 0;
74  num_retries_ = 0;
75  backoff_ms_ = 0;
78 
79  allow_failure_ = false;
80 
81  memset(&zstream_, 0, sizeof(zstream_));
82 }
83 
84 } // namespace download
const std::string * extra_info_
Definition: jobinfo.h:85
const std::string * url_
Definition: jobinfo.h:72
UniquePtr< Pipe< kPipeDownloadJobsResults > > pipe_job_results
Pipe used for the return value.
Definition: jobinfo.h:68
int64_t atomic_int64
Definition: atomic.h:18
bool follow_redirects_
Definition: jobinfo.h:76
bool head_request_
Definition: jobinfo.h:75
std::string link_
Definition: jobinfo.h:101
unsigned backoff_ms_
Definition: jobinfo.h:109
const shash::Any * expected_hash_
Definition: jobinfo.h:84
curl_slist * headers_
Definition: jobinfo.h:93
unsigned char num_used_hosts_
Definition: jobinfo.h:107
z_stream zstream_
Definition: jobinfo.h:98
int64_t id_
Definition: jobinfo.h:66
static atomic_int64 next_uuid
Definition: jobinfo.h:65
unsigned char num_used_proxies_
Definition: jobinfo.h:105
int current_metalink_chain_index_
Definition: jobinfo.h:110
bool force_nocache_
Definition: jobinfo.h:77
bool IsFileNotFound()
Definition: jobinfo.cc:33
char * tracing_header_uid_
Definition: jobinfo.h:97
cvmfs::Sink * sink_
Definition: jobinfo.h:83
char * tracing_header_pid_
Definition: jobinfo.h:95
bool compressed_
Definition: jobinfo.h:73
void * cred_data_
Definition: jobinfo.h:81
char * tracing_header_gid_
Definition: jobinfo.h:96
bool allow_failure_
Definition: jobinfo.h:114
Failures error_code_
Definition: jobinfo.h:103
off_t range_offset_
Definition: jobinfo.h:88
bool HasPrefix(const string &str, const string &prefix, const bool ignore_case)
Definition: string.cc:279
off_t range_size_
Definition: jobinfo.h:89
char * info_header_
Definition: jobinfo.h:94
unsigned char num_retries_
Definition: jobinfo.h:108
InterruptCue * interrupt_cue_
Definition: jobinfo.h:82
int current_host_chain_index_
Definition: jobinfo.h:111
CURL * curl_handle_
Definition: jobinfo.h:92
bool probe_hosts_
Definition: jobinfo.h:74
unsigned char num_used_metalinks_
Definition: jobinfo.h:106