From e4b48f2fb6d1c0d5c4b17aa50a2a45725c0bc4ee Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 26 Feb 2011 08:32:34 -0800 Subject: Support scheme-specific pipelined hosts. --- MobileCydia.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'MobileCydia.mm') diff --git a/MobileCydia.mm b/MobileCydia.mm index af616c4..6b43a70 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4210,7 +4210,7 @@ static NSMutableSet *Diversions_; if (false); else if (selector == @selector(addBridgedHost:)) return @"addBridgedHost"; - else if (selector == @selector(addPipelinedHost:)) + else if (selector == @selector(addPipelinedHost:scheme:)) return @"addPipelinedHost"; else if (selector == @selector(addTrivialSource:)) return @"addTrivialSource"; @@ -4324,7 +4324,10 @@ static NSMutableSet *Diversions_; [BridgedHosts_ performSelectorOnMainThread:@selector(addObject:) withObject:host waitUntilDone:NO]; } -- (void) addPipelinedHost:(NSString *)host { +- (void) addPipelinedHost:(NSString *)host scheme:(NSString *)scheme { + if (scheme != (id) [WebUndefined undefined]) + host = [NSString stringWithFormat:@"%@:%@", [scheme lowercaseString], host]; + [PipelinedHosts_ performSelectorOnMainThread:@selector(addObject:) withObject:host waitUntilDone:NO]; } @@ -10032,9 +10035,12 @@ MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest NSURL *url([copy URL]); NSString *host([url host]); + NSString *scheme([[url scheme] lowercaseString]); + + NSString *compound([NSString stringWithFormat:@"%@:%@", scheme, host]); if ([copy respondsToSelector:@selector(setHTTPShouldUsePipelining:)]) - if ([PipelinedHosts_ containsObject:host]) + if ([PipelinedHosts_ containsObject:host] || [PipelinedHosts_ containsObject:compound]) [copy setHTTPShouldUsePipelining:YES]; if ((self = _NSURLConnection$init$(self, _cmd, copy, delegate, usesCache, maxContentLength, startImmediately, connectionProperties)) != nil) { -- cgit v1.2.3