From a06e917990ac665d730260679dee4264a2c286ea Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 3 Mar 2011 12:03:35 -0800 Subject: Factor SDURLCache debugging into Cydia. --- MobileCydia.mm | 31 ++++++++++++++++++++++++++++++- SDURLCache | 2 +- 2 files changed, 31 insertions(+), 2 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"] diff --git a/SDURLCache b/SDURLCache index 7f0e7cb..234a1d6 160000 --- a/SDURLCache +++ b/SDURLCache @@ -1 +1 @@ -Subproject commit 7f0e7cb1283e56f9cb140d02bd6f5066733dcdc0 +Subproject commit 234a1d60a257fe502a1228a74c40b9deebe2d920 -- cgit v1.2.3