修正404 url导致的卡顿问题

This commit is contained in:
AriaLyy
2017-03-07 09:53:26 +08:00
parent f479b809b5
commit c03d119b56
2 changed files with 5 additions and 1 deletions

View File

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

View File

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