From c88edf1d276eb4e01b92835163bdd8574ded93db Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:10 +0000 Subject: Sync Author: jgg Date: 1998-10-24 04:57:55 GMT Sync --- apt-pkg/acquire.cc | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire.cc') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 80fee9af2..21aade75d 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.3 1998/10/22 04:56:43 jgg Exp $ +// $Id: acquire.cc,v 1.4 1998/10/24 04:58:01 jgg Exp $ /* ###################################################################### Acquire - File Acquiration @@ -331,7 +331,7 @@ void pkgAcquire::Queue::Enqueue(Item *Owner,string URI,string Description) Owner->QueueCounter++; } /*}}}*/ -// Queue::Dequeue - Remove and item from the queue /*{{{*/ +// Queue::Dequeue - Remove an item from the queue /*{{{*/ // --------------------------------------------------------------------- /* */ void pkgAcquire::Queue::Dequeue(Item *Owner) @@ -367,6 +367,7 @@ bool pkgAcquire::Queue::Startup() if (Workers->Start() == false) return false; + Items->Worker = Workers; Workers->QueueItem(Items); return true; @@ -389,3 +390,30 @@ bool pkgAcquire::Queue::Shutdown() return true; } /*}}}*/ +// Queue::Finditem - Find a URI in the item list /*{{{*/ +// --------------------------------------------------------------------- +/* */ +pkgAcquire::Queue::QItem *pkgAcquire::Queue::FindItem(string URI,pkgAcquire::Worker *Owner) +{ + for (QItem *I = Items; I != 0; I = I->Next) + if (I->URI == URI && I->Worker == Owner) + return I; + return 0; +} + /*}}}*/ +// Queue::ItemDone - Item has been completed /*{{{*/ +// --------------------------------------------------------------------- +/* The worker signals this which causes the item to be removed from the + queue. */ +bool pkgAcquire::Queue::ItemDone(QItem *Itm) +{ + Dequeue(Itm->Owner); + + if (Items == 0) + return true; + + Items->Worker = Workers; + Items->Owner->Status = pkgAcquire::Item::StatFetching; + return Workers->QueueItem(Items); +} + /*}}}*/ -- cgit v1.2.3