summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire.cc10
-rwxr-xr-xtest/integration/test-apt-update-simple3
2 files changed, 9 insertions, 4 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 6cf8b4c83..776c82b3b 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -307,7 +307,7 @@ static bool CheckForBadItemAndFailIt(pkgAcquire::Item * const Item,
void pkgAcquire::Enqueue(ItemDesc &Item)
{
// Determine which queue to put the item in
- const MethodConfig *Config;
+ const MethodConfig *Config = nullptr;
string Name = QueueName(Item.URI,Config);
if (Name.empty() == true)
{
@@ -387,14 +387,16 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
{
constexpr int DEFAULT_HOST_LIMIT = 10;
URI U(Uri);
- // Access mode forces all methods to be Single-Instance
- if (QueueMode == QueueAccess)
- return U.Access;
+ // Note that this gets written through the reference to the caller.
Config = GetConfig(U.Access);
if (Config == nullptr)
return {};
+ // Access mode forces all methods to be Single-Instance
+ if (QueueMode == QueueAccess)
+ return U.Access;
+
// Single-Instance methods get exactly one queue per URI
if (Config->SingleInstance == true)
return U.Access;
diff --git a/test/integration/test-apt-update-simple b/test/integration/test-apt-update-simple
index ccf719790..ff1d3758b 100755
--- a/test/integration/test-apt-update-simple
+++ b/test/integration/test-apt-update-simple
@@ -31,3 +31,6 @@ main/binary-amd64/Packages
main/binary-all/Packages
main/i18n/Translation-en
main/i18n/Translation-de' aptget indextargets --format '$(METAKEY)'
+
+find rootdir/var/lib/apt/lists/ -type f -delete
+testsuccess aptget update -o Acquire::Queue-Mode=access