修正404 url导致的卡顿问题

pull/330/head
AriaLyy 8 years ago
parent f479b809b5
commit c03d119b56
  1. 5
      Aria/src/main/java/com/arialyy/aria/core/download/DownloadUtil.java
  2. 1
      Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java

@ -225,8 +225,11 @@ final class DownloadUtil implements IDownloadUtil, Runnable {
mListener.supportBreakpoint(false); mListener.supportBreakpoint(false);
Log.w(TAG, "该下载链接不支持断点下载"); Log.w(TAG, "该下载链接不支持断点下载");
handleBreakpoint(conn); handleBreakpoint(conn);
} else if (code == HttpURLConnection.HTTP_NOT_FOUND) {
Log.w(TAG, "任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,错误码:404");
mListener.onCancel();
} else { } else {
failDownload("任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,返回码:" + code); failDownload("任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,错误码:" + code);
} }
} catch (IOException e) { } catch (IOException e) {
failDownload("下载失败【downloadUrl:" failDownload("下载失败【downloadUrl:"

@ -216,6 +216,7 @@ final class UploadUtil implements Runnable {
mHttpConn.disconnect(); mHttpConn.disconnect();
} else { } else {
Log.w(TAG, "state_code = " + status); Log.w(TAG, "state_code = " + status);
mListener.onFail();
} }
writer.flush(); writer.flush();

Loading…
Cancel
Save