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
# 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