GCC Code Coverage Report


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