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