diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:25 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:25 +0000 |
commit | 18ef0a788491295e833962feb518c276923a0e43 (patch) | |
tree | dc84abad0104171abf24f95a76c2e527a78ddf62 /apt-pkg/acquire-worker.cc | |
parent | e3bf76d14b69295feb066e4f4f8dffb3b964e9a1 (diff) |
Fixed up dpkginit and acquire stuff..
Author: jgg
Date: 1999-07-30 05:36:52 GMT
Fixed up dpkginit and acquire stuff..
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r-- | apt-pkg/acquire-worker.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 6d70e79d8..166055bfc 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-worker.cc,v 1.23 1999/07/26 17:46:07 jgg Exp $ +// $Id: acquire-worker.cc,v 1.24 1999/07/30 05:36:52 jgg Exp $ /* ###################################################################### Acquire Worker @@ -40,7 +40,9 @@ pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf, Config = Cnf; Access = Cnf->Access; CurrentItem = 0; - + TotalSize = 0; + CurrentSize = 0; + Construct(); } /*}}}*/ @@ -53,6 +55,8 @@ pkgAcquire::Worker::Worker(MethodConfig *Cnf) Config = Cnf; Access = Cnf->Access; CurrentItem = 0; + TotalSize = 0; + CurrentSize = 0; Construct(); } @@ -244,8 +248,14 @@ bool pkgAcquire::Worker::RunMessages() pkgAcquire::Item *Owner = Itm->Owner; pkgAcquire::ItemDesc Desc = *Itm; OwnerQ->ItemDone(Itm); - Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()), - LookupTag(Message,"MD5-Hash")); + Pulse(); + if (TotalSize != 0 && + atoi(LookupTag(Message,"Size","0").c_str()) != TotalSize) + _error->Warning("Bizzar Error - File size is not what the server reported %s %u", + LookupTag(Message,"Size","0").c_str(),TotalSize); + + Owner->Done(Message,CurrentSize, + LookupTag(Message,"MD5-Hash")); ItemDone(); // Log that we are done @@ -261,7 +271,7 @@ bool pkgAcquire::Worker::RunMessages() } else Log->Done(Desc); - } + } break; } @@ -495,6 +505,10 @@ void pkgAcquire::Worker::Pulse() if (stat(CurrentItem->Owner->DestFile.c_str(),&Buf) != 0) return; CurrentSize = Buf.st_size; + + // Hmm? Should not happen... + if (CurrentSize > TotalSize && TotalSize != 0) + TotalSize = CurrentSize; } /*}}}*/ // Worker::ItemDone - Called when the current item is finished /*{{{*/ |