Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe11978

Browse files
committedAug 21, 2017
fix: fix raise 416 response http status because of the last connection range is wrong when resume downloading with the last connection has been downloaded
Closes lingochamp#737
1 parent 72f3fe2 commit fe11978

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ private void fetchWithMultipleConnection(final List<ConnectionModel> connectionM
587587
final String path = model.getTempFilePath();
588588

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

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

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

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

0 commit comments

Comments
 (0)
Failed to load comments.