summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
commit3b310a644d82abeb76b5028a9ee7b8d1b96fc629 (patch)
tree4f700ae465eb6c065dfba405741c1ab800e06f11 /apt-pkg/acquire-worker.cc
parentc996a75cabffa5d3e5bc610d9f1097c2edae606f (diff)
parent4fdb612374655361c8923a4611db6a0d10054317 (diff)
merged from the debian branch
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index ddd8e3101..75e03232a 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -287,10 +287,10 @@ bool pkgAcquire::Worker::RunMessages()
Log->Pulse(Owner->GetOwner());
OwnerQ->ItemDone(Itm);
- if (TotalSize != 0 &&
- (unsigned)atoi(LookupTag(Message,"Size","0").c_str()) != TotalSize)
- _error->Warning("Bizarre Error - File size is not what the server reported %s %lu",
- LookupTag(Message,"Size","0").c_str(),TotalSize);
+ unsigned long const ServerSize = atol(LookupTag(Message,"Size","0").c_str());
+ if (TotalSize != 0 && ServerSize != TotalSize)
+ _error->Warning("Size of file %s is not what the server reported %s %lu",
+ Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize);
// see if there is a hash to verify
string RecivedHash;
@@ -309,8 +309,7 @@ bool pkgAcquire::Worker::RunMessages()
<< endl << endl;
}
}
- Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
- RecivedHash.c_str(), Config);
+ Owner->Done(Message, ServerSize, RecivedHash.c_str(), Config);
ItemDone();
// Log that we are done