summaryrefslogtreecommitdiff
path: root/data/apt
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2009-01-21 10:15:08 +0000
committerJay Freeman <saurik@saurik.com>2009-01-21 10:15:08 +0000
commit01edec7233becf79f3f33a61c3c1e1e3a2bb77ae (patch)
tree2ee440841f6b9859e14d7215e5ab411dbbb85fcf /data/apt
parentf980c543c23bd28844cd99b35970db896138f841 (diff)
Added no-cache cache control to APT.
git-svn-id: http://svn.telesphoreo.org/trunk@532 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/apt')
-rw-r--r--data/apt/cfnetwork.diff11
1 files changed, 8 insertions, 3 deletions
diff --git a/data/apt/cfnetwork.diff b/data/apt/cfnetwork.diff
index 7b9fbd90a..03d5edcbd 100644
--- a/data/apt/cfnetwork.diff
+++ b/data/apt/cfnetwork.diff
@@ -74,7 +74,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,256 @@
+@@ -1062,159 +1117,261 @@
if (Queue == 0)
continue;
@@ -176,11 +176,16 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
+ 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_);
@@ -192,7 +197,7 @@ diff -ru apt-0.6.46.4.1/methods/http.cc apt-0.6.46.4.1+iPhone/methods/http.cc
+ 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);