修复40x错误,会继续重试并且无法重试成功的问题 https://github.com/AriaLyy/Aria/issues/619

This commit is contained in:
laoyuyu
2020-02-20 22:01:12 +08:00
parent ad58dce395
commit ea2e27f3e9
4 changed files with 8 additions and 11 deletions

View File

@@ -228,15 +228,15 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable {
mTaskWrapper.setNewTask(true);
mTaskWrapper.setSupportBP(false);
end = true;
} else if (code == HttpURLConnection.HTTP_NOT_FOUND) {
failDownload(new AriaHTTPException(TAG,
String.format("任务下载失败errorCode404, url: %s", mEntity.getUrl())), false);
} else if (code == HttpURLConnection.HTTP_MOVED_TEMP
} else if (code == HttpURLConnection.HTTP_MOVED_TEMP
|| code == HttpURLConnection.HTTP_MOVED_PERM
|| code == HttpURLConnection.HTTP_SEE_OTHER
|| code == HttpURLConnection.HTTP_CREATED // 201 跳转
|| code == 307) {
handleUrlReTurn(conn, conn.getHeaderField("Location"));
} else if (code >= HttpURLConnection.HTTP_BAD_REQUEST) {
failDownload(new AriaHTTPException(TAG,
String.format("任务下载失败errorCode%s, url: %s", code, mEntity.getUrl())), false);
} else {
failDownload(new AriaHTTPException(TAG,
String.format("任务下载失败errorCode%s, errorMsg: %s, url: %s", code,