From: David Kalnischkies Date: Fri, 23 Dec 2016 11:36:16 +0000 (+0100) Subject: do not generate Maximum-Size if we already have that field X-Git-Tag: 1.4_beta3~16 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/8bab752d3beb2d7ce791bf93dd8b52cfb1f718b0 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 --- 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))