From d16fae55a51f98ea73ac70c83670fb1ccf18bb77 Mon Sep 17 00:00:00 2001 From: Jay Freeman Date: Mon, 4 Aug 2008 19:17:50 +0000 Subject: Fixed URLs with +'s not downloading from CDN. git-svn-id: http://svn.telesphoreo.org/trunk@414 514c082c-b64e-11dc-b46d-3d985efe055d --- data/apt/cfnetwork.diff | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'data/apt/cfnetwork.diff') diff --git a/data/apt/cfnetwork.diff b/data/apt/cfnetwork.diff index f4c170084..3f865b154 100644 --- a/data/apt/cfnetwork.diff +++ b/data/apt/cfnetwork.diff @@ -73,7 +73,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc string HttpMethod::FailFile; int HttpMethod::FailFd = -1; time_t HttpMethod::FailTime = 0; -@@ -1062,159 +1117,249 @@ +@@ -1062,159 +1117,257 @@ if (Queue == 0) continue; @@ -152,6 +152,14 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc + + 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); -- cgit v1.2.3