is_test = self.params.get('test', False)
chunk_size = self._TEST_FILE_SIZE if is_test else (
is_test = self.params.get('test', False)
chunk_size = self._TEST_FILE_SIZE if is_test else (
ctx.data_len = None
ctx.block_size = self.params.get('buffersize', 1024)
ctx.start_time = time.time()
ctx.data_len = None
ctx.block_size = self.params.get('buffersize', 1024)
ctx.start_time = time.time()
if self.params.get('continuedl', True):
# Establish possible resume length
if self.params.get('continuedl', True):
# Establish possible resume length
req.add_header('Range', range_header)
def establish_connection():
req.add_header('Range', range_header)
def establish_connection():
if range_end and ctx.data_len is not None and range_end >= ctx.data_len:
range_end = ctx.data_len - 1
has_range = range_start is not None
if range_end and ctx.data_len is not None and range_end >= ctx.data_len:
range_end = ctx.data_len - 1
has_range = range_start is not None
# to match the value of requested Range HTTP header. This is due to a webservers
# that don't support resuming and serve a whole file with no Content-Range
# set in response despite of requested Range (see
# to match the value of requested Range HTTP header. This is due to a webservers
# that don't support resuming and serve a whole file with no Content-Range
# set in response despite of requested Range (see
# Chunked download and requested piece or
# its part is promised to be served
content_range_end == range_end or
# Chunked download and requested piece or
# its part is promised to be served
content_range_end == range_end or