X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6d5dd02a49b18017c296c2d76bc6bb1d9f1ef6ac..bebdca4bf63ae661c60bc1e0f4e03e6bbb7a7cc5:/apt-pkg/acquire.cc diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index aadfe2efb..07e4fab59 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire.cc,v 1.28 1999/03/15 08:10:39 jgg Exp $ +// $Id: acquire.cc,v 1.32 1999/04/07 06:02:56 jgg Exp $ /* ###################################################################### Acquire - File Acquiration @@ -25,6 +25,7 @@ #include #include +#include /*}}}*/ // Acquire::pkgAcquire - Constructor /*{{{*/ @@ -297,7 +298,13 @@ bool pkgAcquire::Run() FD_ZERO(&WFds); SetFds(Highest,&RFds,&WFds); - int Res = select(Highest+1,&RFds,&WFds,0,&tv); + int Res; + do + { + Res = select(Highest+1,&RFds,&WFds,0,&tv); + } + while (Res < 0 && errno == EINTR); + if (Res < 0) { _error->Errno("select","Select has failed"); @@ -413,6 +420,18 @@ unsigned long pkgAcquire::FetchNeeded() return Total; } /*}}}*/ +// Acquire::PartialPresent - Number of partial bytes we already have /*{{{*/ +// --------------------------------------------------------------------- +/* This is the number of bytes that is not local */ +unsigned long pkgAcquire::PartialPresent() +{ + unsigned long Total = 0; + for (pkgAcquire::Item **I = ItemsBegin(); I != ItemsEnd(); I++) + if ((*I)->Local == false) + Total += (*I)->PartialSize; + return Total; +} + /*}}}*/ // pkgAcquire::UriBegin - Start iterator for the uri list /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -691,8 +710,6 @@ void pkgAcquireStatus::Pulse(pkgAcquire *Owner) TotalBytes = 1; if (Unknown == Count) TotalBytes = Unknown; - else - TotalBytes += TotalBytes/(Count - Unknown)*Unknown; // Compute the CPS struct timeval NewTime;