Check completed download size against Content-Length header.

If the number of bytes received is less than the reported content length (e.g. a network timeout), mark the download with the "error" status instead of "complete".  Content-Length should be reliable if reported at all, so this should be a valid approach.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-08-30 23:18:46 -05:00
parent bd8e35cb81
commit aed5163a83
2 changed files with 13 additions and 6 deletions

View File

@@ -174,9 +174,7 @@ public class MengSkyServer extends DownloadServer {
continue;
}
DownloadNode node = new DownloadNode(id, date, title, titleUnicode, artist, artistUnicode, creator);
System.out.println(node);
nodeList.add(node);
nodeList.add(new DownloadNode(id, date, title, titleUnicode, artist, artistUnicode, creator));
}
nodes = nodeList.toArray(new DownloadNode[nodeList.size()]);