]> git.saurik.com Git - cydia.git/commitdiff
Support scheme-specific pipelined hosts.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 26 Feb 2011 16:32:34 +0000 (08:32 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:24 +0000 (02:41 -0800)
MobileCydia.mm

index af616c4c193c748aeae38bbfa88603db7a678045..6b43a70b3dfd7fef5628557c4efb77bfe939d1d3 100644 (file)
@@ -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) {