summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-24 10:35:08 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-25 15:35:52 +0200
commit30979dd7616105302f06af82f419eb62d7b613f8 (patch)
tree1bacc60224a2a26ef4fe70fb4a5db8232051f84d /apt-pkg/acquire-worker.cc
parent0340069cc4709a18ba117090763d9f263de999a9 (diff)
show more details for "Writing more data" errors, too
They are the small brothers of the hashsum mismatch, so they deserve a similar treatment even through we have for architectual reasons not a much to display as for hashsum mismatches for now.
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)