summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index c009f402e..69ca6a28e 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -471,18 +471,28 @@ bool pkgAcquire::Worker::RunMessages()
OwnerQ->ItemDone(Itm);
Itm = nullptr;
- bool errTransient;
+ bool errTransient = false, errAuthErr = false;
{
std::string const failReason = LookupTag(Message, "FailReason");
- std::string const reasons[] = { "Timeout", "ConnectionRefused",
- "ConnectionTimedOut", "ResolveFailure", "TmpResolveFailure" };
- errTransient = std::find(std::begin(reasons), std::end(reasons), failReason) != std::end(reasons);
+ {
+ auto const reasons = { "Timeout", "ConnectionRefused",
+ "ConnectionTimedOut", "ResolveFailure", "TmpResolveFailure" };
+ errTransient = std::find(std::begin(reasons), std::end(reasons), failReason) != std::end(reasons);
+ }
+ if (errTransient == false)
+ {
+ auto const reasons = { "HashSumMismatch", "MaximumSizeExceeded" };
+ errAuthErr = std::find(std::begin(reasons), std::end(reasons), failReason) != std::end(reasons);
+ }
}
for (auto const Owner: ItmOwners)
{
- if (errTransient)
+ if (errAuthErr && Owner->GetExpectedHashes().empty() == false)
+ Owner->Status = pkgAcquire::Item::StatAuthError;
+ else if (errTransient)
Owner->Status = pkgAcquire::Item::StatTransientNetworkError;
+
if (isDoomedItem(Owner) == false)
Owner->Failed(Message,Config);
if (Log != nullptr)