GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/network/jobinfo.cc
Date: 2026-01-11 02:35:46
Exec Total Coverage
Lines: 48 57 84.2%
Branches: 2 14 14.3%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #include "jobinfo.h"
6
7 #include "util/string.h"
8
9 namespace download {
10
11 atomic_int64 JobInfo::next_uuid = 0;
12
13 4562 JobInfo::JobInfo(const std::string *u, const bool c, const bool ph,
14
1/2
✓ Branch 2 taken 4562 times.
✗ Branch 3 not taken.
4562 const shash::Any *h, cvmfs::Sink *s) {
15
1/2
✓ Branch 1 taken 4562 times.
✗ Branch 2 not taken.
4562 Init();
16
17 4562 url_ = u;
18 4562 compressed_ = c;
19 4562 probe_hosts_ = ph;
20 4562 expected_hash_ = h;
21 4562 sink_ = s;
22 4562 }
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
33 bool JobInfo::IsFileNotFound() {
34 if (HasPrefix(*url_, "file://", true /* ignore_case */))
35 return error_code_ == kFailHostConnection;
36
37 return http_code_ == 404;
38 }
39
40 4971 void JobInfo::Init() {
41 4971 id_ = atomic_xadd64(&next_uuid, 1);
42 4971 pipe_job_results = NULL;
43 4971 url_ = NULL;
44 4971 compressed_ = false;
45 4971 probe_hosts_ = false;
46 4971 head_request_ = false;
47 4971 follow_redirects_ = false;
48 4971 force_nocache_ = false;
49 4971 pid_ = -1;
50 4971 uid_ = -1;
51 4971 gid_ = -1;
52 4971 cred_data_ = NULL;
53 4971 interrupt_cue_ = NULL;
54 4971 sink_ = NULL;
55 4971 expected_hash_ = NULL;
56 4971 extra_info_ = NULL;
57 //
58 4971 range_offset_ = -1;
59 4971 range_size_ = -1;
60 //
61 4971 curl_handle_ = NULL;
62 4971 headers_ = NULL;
63 4971 info_header_ = NULL;
64 4971 tracing_header_pid_ = NULL;
65 4971 tracing_header_gid_ = NULL;
66 4971 tracing_header_uid_ = NULL;
67 4971 nocache_ = false;
68 4971 error_code_ = kFailOther;
69 4971 http_code_ = -1;
70 4971 link_ = "";
71 4971 num_used_proxies_ = 0;
72 4971 num_used_metalinks_ = 0;
73 4971 num_used_hosts_ = 0;
74 4971 num_retries_ = 0;
75 4971 backoff_ms_ = 0;
76 4971 current_metalink_chain_index_ = -1;
77 4971 current_host_chain_index_ = -1;
78
79 4971 allow_failure_ = false;
80
81 4971 memset(&zstream_, 0, sizeof(zstream_));
82 4971 }
83
84 } // namespace download
85