mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Fixed a serious bug which could cause a server to DDoS'd in the case of appcast parse failure.
Sparkle now sets the "last checked at" time when it makes the appcast request instead of on successful receipt of an appcast.
This commit is contained in:
1 parent
cbaa635a89
commit
251706d646
1 file changed
+3
-6
@@ -28,6 +28,7 @@
|
||||
[appcast setDelegate:self];
|
||||
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b2", [hostBundle name], [hostBundle displayVersion]]];
|
||||
[appcast fetchAppcastFromURL:appcastURL];
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
|
||||
}
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui
|
||||
@@ -60,11 +61,7 @@
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:forHostBundle:)])
|
||||
[delegate appcastDidFinishLoading:ac forHostBundle:hostBundle];
|
||||
|
||||
NSArray* updates = [ac items];
|
||||
if ([updates count] > 0)
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
|
||||
|
||||
|
||||
// Now we have to find the best valid update in the appcast.
|
||||
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:forHostBundle:)]) // Does the delegate want to handle it?
|
||||
{
|
||||
@@ -73,7 +70,7 @@
|
||||
else // If not, we'll take care of it ourselves.
|
||||
{
|
||||
// Find the first update we can actually use.
|
||||
NSEnumerator *updateEnumerator = [updates objectEnumerator];
|
||||
NSEnumerator *updateEnumerator = [[ac items] objectEnumerator];
|
||||
do {
|
||||
updateItem = [updateEnumerator nextObject];
|
||||
} while (updateItem && ![self hostSupportsItem:updateItem]);
|
||||
|
||||
Reference in new issue
Block a user