diff options
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r-- | apt-pkg/acquire-worker.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 4f0b52af9..75e03232a 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -199,6 +199,17 @@ bool pkgAcquire::Worker::RunMessages() pkgAcquire::Queue::QItem *Itm = 0; if (URI.empty() == false) Itm = OwnerQ->FindItem(URI,this); + + // update used mirror + string UsedMirror = LookupTag(Message,"UsedMirror", ""); + if (!UsedMirror.empty() && + Itm && + Itm->Description.find(" ") != string::npos) + { + Itm->Description.replace(0, Itm->Description.find(" "), UsedMirror); + // FIXME: will we need this as well? + //Itm->ShortDesc = UsedMirror; + } // Determine the message number and dispatch switch (Number) @@ -276,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; @@ -298,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 |