]> git.saurik.com Git - apt-legacy.git/commitdiff
Fixed URLs with +'s not downloading from CDN.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 4 Aug 2008 19:17:50 +0000 (19:17 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 4 Aug 2008 19:17:50 +0000 (19:17 +0000)
M cfnetwork.diff

git-svn-id: http://svn.telesphoreo.org/trunk@414 514c082c-b64e-11dc-b46d-3d985efe055d

methods/http.cc
methods/http.cc.orig

index eb39da73ff76ab1a3298be4ee32082080993797d..b512c5cb3fbe8c074c7300a30406695cca338b8e 100644 (file)
@@ -1127,6 +1127,14 @@ int HttpMethod::Loop()
 
       std::string urs = uri;
 
+      for (;;) {
+         size_t bad = urs.find_first_of("+");
+         if (bad == std::string::npos)
+            break;
+         // XXX: generalize
+         urs = urs.substr(0, bad) + "%2b" + urs.substr(bad + 1);
+      }
+
       CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se);
       CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL);
       CFRelease(sr);
index 650bad052a21cc2fae8c783ae20b647f4b49b29e..75930cab37cd276647215a81326430c1cf3e7366 100644 (file)
@@ -1123,6 +1123,14 @@ int HttpMethod::Loop()
 
       std::string urs = uri;
 
+      for (;;) {
+         size_t bad = urs.find_first_of("+");
+         if (bad == std::string::npos)
+            break;
+         // XXX: generalize
+         urs = urs.substr(0, bad) + "%2b" + urs.substr(bad + 1);
+      }
+
       CFStringRef sr = CFStringCreateWithCString(kCFAllocatorDefault, urs.c_str(), se);
       CFURLRef ur = CFURLCreateWithString(kCFAllocatorDefault, sr, NULL);
       CFRelease(sr);