diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-03 12:03:35 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:35 -0800 |
commit | a06e917990ac665d730260679dee4264a2c286ea (patch) | |
tree | 08d278eb184c3988890d2c152cdb26d9516befe7 /MobileCydia.mm | |
parent | 793aee35be63220c75bf0310e8f7f890b05274fc (diff) |
Factor SDURLCache debugging into Cydia.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 0303557..df67f54 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8760,6 +8760,35 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ +@interface CYURLCache : SDURLCache { +} + +@end + +@implementation CYURLCache + +- (void) logEvent:(NSString *)event forRequest:(NSURLRequest *)request { +#if !ForRelease + if (false); + else if ([event isEqualToString:@"no-cache"]) + event = @"!!!"; + else if ([event isEqualToString:@"store"]) + event = @">>>"; + else if ([event isEqualToString:@"invalid"]) + event = @"???"; + else if ([event isEqualToString:@"memory"]) + event = @"mem"; + else if ([event isEqualToString:@"disk"]) + event = @"ssd"; + else if ([event isEqualToString:@"miss"]) + event = @"---"; + + NSLog(@"%@: %@", event, [[request URL] absoluteString]); +#endif +} + +@end + @interface Cydia : UIApplication < ConfirmationControllerDelegate, DatabaseDelegate, @@ -9587,7 +9616,7 @@ _trace(); [BridgedHosts_ addObject:[[NSURL URLWithString:CydiaURL(@"")] host]]; } - [NSURLCache setSharedURLCache:[[[SDURLCache alloc] + [NSURLCache setSharedURLCache:[[[CYURLCache alloc] initWithMemoryCapacity:524288 diskCapacity:10485760 diskPath:[NSString stringWithFormat:@"%@/Library/Caches/com.saurik.Cydia/SDURLCache", @"/var/root"] |