diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:53 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:53 +0000 |
commit | 5cb5d8dc4318227ca3ec8976f67e8cfd2302d1ff (patch) | |
tree | 026fae4811ede2b7fc28773a8f4ef3042007fab8 /apt-pkg | |
parent | f01fe790891daf085b3a16ce8be3498fcc329d6e (diff) |
HTTP pipelining
Author: jgg
Date: 1998-12-05 04:19:01 GMT
HTTP pipelining
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-method.cc | 13 | ||||
-rw-r--r-- | apt-pkg/acquire-method.h | 3 | ||||
-rw-r--r-- | apt-pkg/acquire.cc | 13 |
3 files changed, 24 insertions, 5 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index b0176d3cb..8b1de6fb3 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-method.cc,v 1.13 1998/12/05 01:45:19 jgg Exp $ +// $Id: acquire-method.cc,v 1.14 1998/12/05 04:19:01 jgg Exp $ /* ###################################################################### Acquire Method @@ -47,8 +47,9 @@ pkgAcqMethod::pkgAcqMethod(const char *Ver,unsigned long Flags) exit(100); SetNonBlock(STDIN_FILENO,true); - + Queue = 0; + QueueBack = 0; } /*}}}*/ // AcqMethod::Fail - A fetch has failed /*{{{*/ @@ -78,6 +79,8 @@ void pkgAcqMethod::Fail(string Err,bool Transient) FetchItem *Tmp = Queue; Queue = Queue->Next; delete Tmp; + if (Tmp == QueueBack) + QueueBack = Queue; } else snprintf(S,sizeof(S),"400 URI Failure\nURI: <UNKNOWN>\n" @@ -183,6 +186,8 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt) FetchItem *Tmp = Queue; Queue = Queue->Next; delete Tmp; + if (Tmp == QueueBack) + QueueBack = Queue; } /*}}}*/ // AcqMethod::MediaFail - Syncronous request for new media /*{{{*/ @@ -328,7 +333,9 @@ int pkgAcqMethod::Run(bool Single) FetchItem **I = &Queue; for (; *I != 0; I = &(*I)->Next); *I = Tmp; - + if (QueueBack == 0) + QueueBack = Tmp; + // Notify that this item is to be fetched. if (Fetch(Tmp) == false) Fail(); diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index 69ed28585..cefb60468 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-method.h,v 1.6 1998/12/04 22:56:51 jgg Exp $ +// $Id: acquire-method.h,v 1.7 1998/12/05 04:19:02 jgg Exp $ /* ###################################################################### Acquire Method - Method helper class + functions @@ -48,6 +48,7 @@ class pkgAcqMethod // State vector<string> Messages; FetchItem *Queue; + FetchItem *QueueBack; // Handlers for messages virtual bool Configuration(string Message); diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 54de9916e..b7ef818a1 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.19 1998/11/29 01:24:19 jgg Exp $ +// $Id: acquire.cc,v 1.20 1998/12/05 04:19:03 jgg Exp $ /* ###################################################################### Acquire - File Acquiration @@ -514,6 +514,17 @@ bool pkgAcquire::Queue::Startup() if (Workers->Start() == false) return false; + /* When pipelining we commit 10 items. This needs to change when we + added other source retry to have cycle maintain a pipeline depth + on its own. */ + if (Cnf->Pipeline == true) + { + bool Res = true; + for (int I = 0; I != 10 && Res == true; I++) + Res &= Cycle(); + return Res; + } + return Cycle(); } /*}}}*/ |