Skip to content

Commit

Permalink
fix: fix raise 416 response http status because of the last connectio…
Browse files Browse the repository at this point in the history
…n range is wrong when resume downloading with the last connection has been downloaded

Closes #737
  • Loading branch information
Jacksgong committed Aug 21, 2017
1 parent 72f3fe2 commit fe11978
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ private void fetchWithMultipleConnection(final List<ConnectionModel> connectionM
final String path = model.getTempFilePath();

if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "fetch data with multiple connection(count: [%d]) for task[%d]",
connectionModelList.size(), id);
FileDownloadLog.d(this, "fetch data with multiple connection(count: [%d]) for task[%d] totalLength[%d]",
connectionModelList.size(), id, totalLength);
}

long totalOffset = 0;
Expand All @@ -607,7 +607,7 @@ private void fetchWithMultipleConnection(final List<ConnectionModel> connectionM

totalOffset += (connectionModel.getCurrentOffset() - connectionModel.getStartOffset());

if (connectionModel.getEndOffset() == connectionModel.getCurrentOffset() - 1) {
if (contentLength == 0) {
// [start, end), offset contain the start one, so need - 1.
// it has already done, so pass.
if (FileDownloadLog.NEED_LOG) {
Expand Down

0 comments on commit fe11978

Please sign in to comment.