]> git.saurik.com Git - cydia.git/commitdiff
Don't use HTTP disk cache on < 3.2.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 21 Mar 2011 00:50:00 +0000 (17:50 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 21 Mar 2011 00:51:10 +0000 (17:51 -0700)
MobileCydia.mm

index 2b16ee261bc4891022eccf799799f0aa736f4fef..3e1b68469e4649c7323f192b08e0104cc7fbf113 100644 (file)
@@ -9739,11 +9739,13 @@ _trace();
         [BridgedHosts_ addObject:[[NSURL URLWithString:CydiaURL(@"")] host]];
     }
 
-    [NSURLCache setSharedURLCache:[[[CYURLCache alloc]
-        initWithMemoryCapacity:524288
-        diskCapacity:10485760
-        diskPath:[NSString stringWithFormat:@"%@/Library/Caches/com.saurik.Cydia/SDURLCache", @"/var/root"]
-    ] autorelease]];
+    // on 3.[01], CFURLCacheResponse is backed by NSURLCacheResponse, and vice versa: fail
+    if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iPhoneOS_3_2)
+        [NSURLCache setSharedURLCache:[[[CYURLCache alloc]
+            initWithMemoryCapacity:524288
+            diskCapacity:10485760
+            diskPath:[NSString stringWithFormat:@"%@/Library/Caches/com.saurik.Cydia/SDURLCache", @"/var/root"]
+        ] autorelease]];
 
     [CydiaWebViewController _initialize];