[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#235668: Returning false from pkgAcquireStatus::Pulse does not cleanly shut down a download.



On Mon, Mar 01, 2004 at 09:59:21PM -0700, Jason Gunthorpe wrote:

> 
> On Mon, 1 Mar 2004, Matt Zimmerman wrote:
> 
> > It's the Shutdown() bit that ends up spewing these errors, right?  So before
> > doing that, we need to go through the items and set their status to
> > StatError or something?
> 
> Yes, when it deletes the items in the queue the destructor calls Dequeue
> which produces the message. Since this isn't threaded I think you can
> just add a line in that loop in shutdown to put the state of each item to
> done before dequeing it.

Something like this?

--- acquire.cc.~1.49.~	2001-05-26 21:28:37.000000000 -0700
+++ acquire.cc	2004-03-01 21:25:09.000000000 -0800
@@ -87,7 +87,11 @@
 void pkgAcquire::Shutdown()
 {
    while (Items.size() != 0)
+   {
+      if (Items[0]->Status == Item::StatFetching)
+         Items[0]->Status = Item::StatError;
       delete Items[0];
+   }
 
    while (Queues != 0)
    {


-- 
 - mdz



Reply to: