zero size of template/volume being registered causes infinite loop on SSVM,

the fix is if the size is 0, return success without download
This commit is contained in:
Anthony Xu 2013-05-29 15:18:20 -07:00
parent a4d428434d
commit 56535a7a83
1 changed files with 7 additions and 0 deletions

View File

@ -250,6 +250,13 @@ public class HttpTemplateDownloader implements TemplateDownloader {
}
} else {
remoteSize2 = Long.parseLong(contentLengthHeader.getValue());
if ( remoteSize2 == 0 ) {
status = TemplateDownloader.Status.DOWNLOAD_FINISHED;
String downloaded = "(download complete remote=" + remoteSize + "bytes)";
errorString = "Downloaded " + totalBytes + " bytes " + downloaded;
downloadTime = 0;
return 0;
}
}
if (remoteSize == 0) {