summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:10 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:10 +0000
commitc88edf1d276eb4e01b92835163bdd8574ded93db (patch)
tree58a2a86710184e87288f16656294606a152ac02a /apt-pkg/acquire-worker.cc
parent24231681aa99e84c8a6aae5e54b7e207e19d6087 (diff)
Sync
Author: jgg Date: 1998-10-24 04:57:55 GMT Sync
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc45
1 files changed, 41 insertions, 4 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index 58f67d979..936d469c3 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.5 1998/10/23 00:49:58 jgg Exp $
+// $Id: acquire-worker.cc,v 1.6 1998/10/24 04:57:58 jgg Exp $
/* ######################################################################
Acquire Worker
@@ -187,6 +187,11 @@ bool pkgAcquire::Worker::RunMessages()
if (End == Message.c_str())
return _error->Error("Invalid message from method %s: %s",Access.c_str(),Message.c_str());
+ string URI = LookupTag(Message,"URI");
+ pkgAcquire::Queue::QItem *Itm = 0;
+ if (URI.empty() == false)
+ Itm = OwnerQ->FindItem(URI,this);
+
// Determine the message number and dispatch
switch (Number)
{
@@ -209,15 +214,47 @@ bool pkgAcquire::Worker::RunMessages()
// 200 URI Start
case 200:
- break;
+ {
+ if (Itm == 0)
+ {
+ _error->Warning("Method gave invalid 200 URI Start message");
+ break;
+ }
+ CurrentItem = Itm;
+ CurrentSize = 0;
+ TotalSize = atoi(LookupTag(Message,"Size","0").c_str());
+
+ break;
+ }
// 201 URI Done
case 201:
- break;
+ {
+ if (Itm == 0)
+ {
+ _error->Warning("Method gave invalid 400 URI Failure message");
+ break;
+ }
+
+ Itm->Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
+ LookupTag(Message,"MD5-Hash"));
+ OwnerQ->ItemDone(Itm);
+ break;
+ }
// 400 URI Failure
case 400:
- break;
+ {
+ if (Itm == 0)
+ {
+ _error->Warning("Method gave invalid 400 URI Failure message");
+ break;
+ }
+
+ Itm->Owner->Failed(Message);
+ OwnerQ->ItemDone(Itm);
+ break;
+ }
// 401 General Failure
case 401: