- # Content-Range is correct - go on
- if content_range_m and resume_len == int(content_range_m.group(1)):
- break
- # Content-Range is invalid - wipe the file and do entire redownload
+ # Content-Range is present and matches requested Range, resume is possible
+ if content_range_m and resume_len == int(content_range_m.group(1)):
+ break
+ # Content-Range is either not present or invalid. Assuming remote webserver is
+ # trying to send the whole file, resume is not possible, so wiping the local file
+ # and performing entire redownload
+ self.report_unable_to_resume()