diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:12 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:12 +0000 |
commit | 8b89e57fa2ae7d34b055b8f804cee0c2c194043b (patch) | |
tree | e064dc401cfa03ed15eaafbc746ecd9bb379a211 /apt-pkg/acquire.cc | |
parent | 92173b19af439ac49d842902a3a57105d396d7d8 (diff) |
Stable acquire code
Author: jgg
Date: 1998-10-26 07:11:43 GMT
Stable acquire code
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r-- | apt-pkg/acquire.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 21aade75d..4ed21831d 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.4 1998/10/24 04:58:01 jgg Exp $ +// $Id: acquire.cc,v 1.5 1998/10/26 07:11:47 jgg Exp $ /* ###################################################################### Acquire - File Acquiration @@ -33,6 +33,7 @@ pkgAcquire::pkgAcquire() Configs = 0; Workers = 0; ToFetch = 0; + Running = false; string Mode = _config->Find("Acquire::Queue-Mode","host"); if (strcasecmp(Mode.c_str(),"host") == 0) @@ -133,6 +134,9 @@ void pkgAcquire::Enqueue(Item *Itm,string URI,string Description) // Queue it into the named queue I->Enqueue(Itm,URI,Description); ToFetch++; + + if (Running == true) + I->Startup(); // Some trace stuff if (Debug == true) @@ -249,6 +253,8 @@ void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet) manage the actual fetch. */ bool pkgAcquire::Run() { + Running = true; + for (Queue *I = Queues; I != 0; I = I->Next) I->Startup(); @@ -263,7 +269,10 @@ bool pkgAcquire::Run() SetFds(Highest,&RFds,&WFds); if (select(Highest+1,&RFds,&WFds,0,0) <= 0) + { + Running = false; return _error->Errno("select","Select has failed"); + } RunFds(&RFds,&WFds); } @@ -271,6 +280,7 @@ bool pkgAcquire::Run() for (Queue *I = Queues; I != 0; I = I->Next) I->Shutdown(); + Running = false; return true; } /*}}}*/ |