From 8bab752d3beb2d7ce791bf93dd8b52cfb1f718b0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 23 Dec 2016 12:36:16 +0100 Subject: 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 --- apt-pkg/acquire-worker.cc | 8 +++++--- 1 file 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)) -- cgit v1.2.3