]> git.saurik.com Git - apt-legacy.git/commitdiff
Added no-cache cache control to APT.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 21 Jan 2009 10:15:08 +0000 (10:15 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 21 Jan 2009 10:15:08 +0000 (10:15 +0000)
M cfnetwork.diff

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

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

index aa6f516db48594698bba20ba6e49b5e4600a8624..5d4848e034ab80351a6a29670e25d6d8eb022fcd 100644 (file)
@@ -1151,11 +1151,16 @@ int HttpMethod::Loop()
          sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(SBuf.st_mtime).c_str(), se);
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Range"), sr);
          CFRelease(sr);
+
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
       } else if (Queue->LastModified != 0) {
          sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(Queue->LastModified).c_str(), se);
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Modified-Since"), sr);
          CFRelease(sr);
-      }
+
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
+      } else
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("max-age=0"));
 
       if (Firmware_ != NULL)
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_);
@@ -1167,7 +1172,7 @@ int HttpMethod::Loop()
       if (UniqueID_ != NULL)
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Unique-ID"), UniqueID_);
 
-      CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98"));
+      CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.484"));
 
       CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm);
       CFRelease(hm);
index e56ec17972fef7eea95e3027c7c0f63887789d6b..2e69a79298abab3039534d7d44ae44ca1ae68870 100644 (file)
@@ -1147,11 +1147,16 @@ int HttpMethod::Loop()
          sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(SBuf.st_mtime).c_str(), se);
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Range"), sr);
          CFRelease(sr);
+
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
       } else if (Queue->LastModified != 0) {
          sr = CFStringCreateWithCString(kCFAllocatorDefault, TimeRFC1123(Queue->LastModified).c_str(), se);
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("If-Modified-Since"), sr);
          CFRelease(sr);
-      }
+
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("no-cache"));
+      } else
+         CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("Cache-Control"), CFSTR("max-age=0"));
 
       if (Firmware_ != NULL)
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_);
@@ -1163,7 +1168,7 @@ int HttpMethod::Loop()
       if (UniqueID_ != NULL)
          CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Unique-ID"), UniqueID_);
 
-      CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.98"));
+      CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("User-Agent"), CFSTR("Telesphoreo APT-HTTP/1.0.484"));
 
       CFReadStreamRef rs = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, hm);
       CFRelease(hm);