summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-26 08:32:34 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:24 -0800
commite4b48f2fb6d1c0d5c4b17aa50a2a45725c0bc4ee (patch)
treee7ae25f9b7e4143f5a968118a6ba3681501d2828 /MobileCydia.mm
parent834c18a40b98da3d3cbccfeb84d266b954a81f25 (diff)
Support scheme-specific pipelined hosts.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm12
1 files changed, 9 insertions, 3 deletions
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) {