Skip to content

Commit 2c27d81

Browse files
author
Tianhua Ran
committed
fix: single connection cannot start download without supporting seek
Closes #1200
1 parent 6237a8c commit 2c27d81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/main/java/com/liulishuo/filedownloader/download/FetchDataTask.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public void run() throws IOException, IllegalAccessException, IllegalArgumentExc
116116

117117
try {
118118
final boolean isSupportSeek = CustomComponentHolder.getImpl().isSupportSeek();
119-
if (hostRunnable != null && !isSupportSeek) {
119+
final boolean isMultiConnection = connectionIndex >= 0;
120+
if (isMultiConnection && !isSupportSeek) {
120121
throw new IllegalAccessException(
121122
"can't using multi-download when the output stream can't support seek");
122123
}

0 commit comments

Comments
 (0)