]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
detect redirection loops in acquire instead of workers
[apt.git] / apt-pkg / acquire-worker.cc
index 39cc55bdf1fb997b56a246b841837df7e8d1640e..1ee78d07031a7dbe226c550e6a251d3e45a78b8f 100644 (file)
@@ -269,6 +269,16 @@ bool pkgAcquire::Worker::RunMessages()
            for (auto const &Owner: ItmOwners)
            {
               pkgAcquire::ItemDesc &desc = Owner->GetItemDesc();
+              if (Owner->IsRedirectionLoop(NewURI))
+              {
+                 std::string msg = Message;
+                 msg.append("\nFailReason: RedirectionLoop");
+                 Owner->Failed(msg, Config);
+                 if (Log != nullptr)
+                    Log->Fail(Owner->GetItemDesc());
+                 continue;
+              }
+
               if (Log != nullptr)
                  Log->Done(desc);