]> git.saurik.com Git - apt-legacy.git/commitdiff
Added support for 301 redirects to the new APT Apple HTTP method.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 22 Apr 2008 03:59:35 +0000 (03:59 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 22 Apr 2008 03:59:35 +0000 (03:59 +0000)
M cfnetwork.diff

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

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

index 2cca8b8b7a154cec9e6d9fcf80e271805dacdcc3..c990dfeb487dc5673546afece878372eb2472f0f 100644 (file)
@@ -1196,7 +1196,7 @@ int HttpMethod::Loop()
       hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader);
       sc = CFHTTPMessageGetResponseStatusCode(hm);
 
-      if (sc == 302) {
+      if (sc == 301 || sc == 302) {
          sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location"));
          if (sr == NULL) {
             Fail();
index 27454b97b8cd825a3d3608e6278d7c562833de7e..0f01d38b412ea2e6bf91a2869d14ad355b61033c 100644 (file)
@@ -1192,7 +1192,7 @@ int HttpMethod::Loop()
       hm = (CFHTTPMessageRef) CFReadStreamCopyProperty(rs, kCFStreamPropertyHTTPResponseHeader);
       sc = CFHTTPMessageGetResponseStatusCode(hm);
 
-      if (sc == 302) {
+      if (sc == 301 || sc == 302) {
          sr = CFHTTPMessageCopyHeaderFieldValue(hm, CFSTR("Location"));
          if (sr == NULL) {
             Fail();