Check download image size

This commit is contained in:
seven332 committed 2016-07-27 23:34:09 +08:00
1 parent 27ca88f0c2
commit 2cb8319c91
1 file changed
+10
@@ -1132,6 +1132,16 @@ public final class SpiderQueen implements Runnable {
}
os.flush();
// check download size
if (contentLength >= 0) {
if (receivedSize < contentLength) {
Log.e(TAG, "Can't download all of image data");
continue;
} else if (receivedSize > contentLength) {
Log.w(TAG, "Received data is more than contentLength");
}
}
// Check interrupted
if (Thread.currentThread().isInterrupted()) {
interrupt = true;