Lines Matching defs:end_offset
79 off_t end_offset{0}; // non-inclusive, zero indicates unspecified.
129 request->end_offset = atoll(range.c_str() + range.find('-') + 1) + 1;
134 if (request->end_offset > 0)
136 (intmax_t)request->end_offset);
180 ssize_t WriteHeaders(int fd, const off_t start_offset, const off_t end_offset,
194 const off_t content_length = end_offset - start_offset;;
198 if (start_offset || start_offset == end_offset) {
202 Itoa(start_offset == end_offset ? 0 : start_offset) +
203 "-" + Itoa(end_offset - 1) + "/" + Itoa(end_offset) +
222 size_t WritePayload(int fd, const off_t start_offset, const off_t end_offset,
224 CHECK_LE(start_offset, end_offset);
229 << end_offset;
239 const size_t total_len = end_offset - start_offset;
273 const off_t end_offset) {
274 return WritePayload(fd, start_offset, end_offset, 'a', 10);
308 size_t end_offset = (request.end_offset > 0 ?
309 request.end_offset : total_length);
310 if (end_offset < start_offset) {
311 LOG(WARNING) << "end offset (" << end_offset << ") precedes start offset ("
315 if (end_offset > total_length) {
316 LOG(INFO) << "requested end offset (" << end_offset
318 end_offset = total_length;
323 << (end_offset - 1) << "/" << (end_offset - start_offset)
325 if ((ret = WriteHeaders(fd, start_offset, end_offset,
332 size_t payload_length = end_offset - start_offset;
337 end_offset = start_offset + payload_length;
341 << (end_offset - 1) << "/" << (end_offset - start_offset);
356 if ((ret = WritePayload(fd, midway_offset, end_offset)) < 0)
361 if ((ret = WritePayload(fd, start_offset, end_offset)) < 0)
427 size_t end_offset, int max_fails) {
451 return HandleGet(fd, request, end_offset);