Check file size after download
This commit may address symptoms seen in #187 and #197 where AntennaPod did not flag incomplete downloads as failed.
This commit is contained in:
parent
941fa9062e
commit
e99c7931f7
@ -114,6 +114,15 @@ public class HttpDownloader extends Downloader {
|
|||||||
onCancelled();
|
onCancelled();
|
||||||
} else {
|
} else {
|
||||||
out.flush();
|
out.flush();
|
||||||
|
if (status.getSize() != DownloadStatus.SIZE_UNKNOWN &&
|
||||||
|
status.getSoFar() != status.getSize()) {
|
||||||
|
onFail(DownloadError.ERROR_IO_ERROR,
|
||||||
|
"Download completed but size: " +
|
||||||
|
status.getSoFar() +
|
||||||
|
" does not equal expected size " +
|
||||||
|
status.getSize());
|
||||||
|
return;
|
||||||
|
}
|
||||||
onSuccess();
|
onSuccess();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user