MCPcopy Create free account
hub / github.com/aria2/aria2 / getEndByte

Method getEndByte

src/HttpRequest.cc:96–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96int64_t HttpRequest::getEndByte() const
97{
98 if (!segment_ || !request_) {
99 return 0;
100 }
101 if (request_->isPipeliningEnabled()) {
102 auto endByte = fileEntry_->gtoloff(segment_->getPosition() +
103 segment_->getLength() - 1);
104 return std::min(endByte, fileEntry_->getLength() - 1);
105 }
106 if (endOffsetOverride_ > 0) {
107 return endOffsetOverride_ - 1;
108 }
109 return 0;
110}
111
112Range HttpRequest::getRange() const
113{

Callers 2

testGetEndByteMethod · 0.80
validateResponseMethod · 0.80

Calls 4

isPipeliningEnabledMethod · 0.80
gtoloffMethod · 0.80
getPositionMethod · 0.45
getLengthMethod · 0.45

Tested by 1

testGetEndByteMethod · 0.64