summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMatt Zimmerman <matt.zimmerman@canonical.com>2004-12-29 01:18:28 +0000
committerMatt Zimmerman <matt.zimmerman@canonical.com>2004-12-29 01:18:28 +0000
commit2ee99a54fd671f74b6ee24307e11ab0534580b87 (patch)
tree0e5e082135ad29f15effaa045b5da2758004e5d8 /apt-pkg/acquire-item.cc
parent51d13ae3354082c12f6e5dd3797c514c6de702b0 (diff)
parent32133629d8c49029f3d04886aa605de4864b486e (diff)
Merge apt--mvo--0
Patches applied: * michael.vogt@canonical.com--2004/apt--mvo--0--patch-5 * added apt-key update method * michael.vogt@canonical.com--2004/apt--mvo--0--patch-6 * if a sign-file download fails, delete the the partial download in "partial/" also * michael.vogt@canonical.com--2004/apt--mvo--0--patch-7 * changelog updated, version is now 0.6.27ubuntu4; added DEB_BUILD_PROG_OPTS to debian/rules * michael.vogt@canonical.com--2004/apt--mvo--0--patch-8 * removed Release.gpg files in partial/ before fetching a new one * michael.vogt@canonical.com--2004/apt--mvo--0--patch-9 * some comments about the pkgAcqMetaSig::Custom600Headers() added * michael.vogt@canonical.com--2004/apt--mvo--0--patch-10 * fix permissions in po/ * michael.vogt@canonical.com--2004/apt--mvo--0--patch-11 * use gpg --with-colons
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index f40c6a50d..de8cfe8f2 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -321,6 +321,10 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
DestFile += URItoFileName(URI);
+ // remove any partial downloaded sig-file. it may confuse proxies
+ // and is too small to warrant a partial download anyway
+ unlink(DestFile.c_str());
+
// Create the item
Desc.Description = URIDesc;
Desc.Owner = this;
@@ -346,13 +350,20 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
/* The only header we use is the last-modified header. */
string pkgAcqMetaSig::Custom600Headers()
{
+ // mvo: we don't really need the last-modified header here
+ // 1) it points to "Final" and that was renamed to "DestFile"
+ // so it's never send anyway
+ // 2) because DestFIle is in partial/ we will send a partial request
+ // with if-range in the http method (or the equivalent for ftp).
+ // that should give the same result
+
string Final = _config->FindDir("Dir::State::lists");
Final += URItoFileName(RealURI);
struct stat Buf;
if (stat(Final.c_str(),&Buf) != 0)
return "\nIndex-File: true";
-
+
return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
}