Only log missing 'length' warning once per all appcast item instances

This commit is contained in:
Zorg committed 2016-08-27 23:58:01 -04:00
1 parent 56cd205880
commit 325059484f
1 file changed
+4 -1
+4 -1
View File
@@ -236,7 +236,10 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT
if (enclosureLengthString != nil) {
contentLength = [enclosureLengthString integerValue];
} else {
SULog(@"warning: <%@> for URL '%@' is missing %@ attribute. Downloading progress may be unreliable. Please always specify %@", SURSSElementEnclosure, [enclosure objectForKey:SURSSAttributeURL], SURSSAttributeLength, SURSSAttributeLength);
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
SULog(@"warning: <%@> for URL '%@' is missing %@ attribute. Downloading progress may be unreliable. Please always specify %@", SURSSElementEnclosure, [enclosure objectForKey:SURSSAttributeURL], SURSSAttributeLength, SURSSAttributeLength);
});
}
_contentLength = (contentLength > 0) ? (NSUInteger)contentLength : 0;
}