diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-12-23 12:36:16 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-12-31 02:29:20 +0100 |
commit | 8bab752d3beb2d7ce791bf93dd8b52cfb1f718b0 (patch) | |
tree | 06ad979cb037d76ac8603b59920f25b02bc44e56 /apt-pkg/acquire-worker.cc | |
parent | 6376dfb8dfb99b9d182c2fb13aa34b2ac89805e3 (diff) |
do not generate Maximum-Size if we already have that field
Any respective parser will do the right thing and grab the last value,
but its better for style to generate that field only once.
Gbp-Dch: Ignore
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r-- | apt-pkg/acquire-worker.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 7d6e6f79c..c15e7ab4c 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -664,6 +664,8 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) if (isDoomedItem(Item->Owner)) return true; + Item->SyncDestinationFiles(); + string Message = "600 URI Acquire\n"; Message.reserve(300); Message += "URI: " + Item->URI; @@ -673,7 +675,9 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) for (HashStringList::const_iterator hs = hsl.begin(); hs != hsl.end(); ++hs) Message += "\nExpected-" + hs->HashType() + ": " + hs->HashValue(); - if (hsl.FileSize() == 0) + Message += Item->Custom600Headers(); + + if (hsl.FileSize() == 0 && Message.find("\nMaximum-Size: ") == std::string::npos) { unsigned long long FileSize = Item->GetMaximumSize(); if(FileSize > 0) @@ -684,8 +688,6 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) } } - Item->SyncDestinationFiles(); - Message += Item->Custom600Headers(); Message += "\n\n"; if (RealFileExists(Item->Owner->DestFile)) |