summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-07-23 15:28:32 +0200
committerMichael Vogt <egon@bottom>2007-07-23 15:28:32 +0200
commit4c58917103875358bb30622daf76d58918336968 (patch)
treeb57f9cc8e9c1afd1e50f5e841bda00ca35cf427a /methods/http.cc
parent6ae549699856b105e840f8345e917e323d9ec591 (diff)
parent394eadc8e13784162fee87c8059bcc214275f4b5 (diff)
* cmdline/apt-get.cc:
- fix in the task-install code regexp (thanks to Adam Conrad and Colin Watson) - support task removal too: apt-get remove taskname^ (thanks to Matt Zimmerman reporting this problem) * Fix a typo on 0.7.3 changelog entry about g++ (7.3 to 4.3) * Fix compilation warnings: - apt-pkg/contrib/configuration.cc: wrong argument type; - apt-pkg/deb/dpkgpm.cc: wrong signess; - apt-pkg-acquire-item.cc: wrong signess and orderned initializers; - methods/https.cc: - type conversion; - unused variable; - changed SetupProxy() method to void; * Simplified HttpMethod::Fetch on http.cc removing Tail variable; * Fix pipeline handling on http.cc (closes: #413324) * Fix building to properly support binNMUs. Thanks to Daniel Schepler <schepler@math.unipd.it> by the patch (closes: #359634) * Fix example for Install-{Recommends,Suggests} options on configure-index example file. Thanks to Peter Eisentraut <peter_e@gmx.net> by the patch (closes: #432223) * fixed compile errors with g++ 4.3 (thanks to
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/methods/http.cc b/methods/http.cc
index d9487be88..d4e231fbe 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -3,7 +3,7 @@
// $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
/* ######################################################################
- HTTP Aquire Method - This is the HTTP aquire method for APT.
+ HTTP Acquire Method - This is the HTTP aquire method for APT.
It uses HTTP/1.1 and many of the fancy options there-in, such as
pipelining, range, if-range and so on.
@@ -996,7 +996,6 @@ bool HttpMethod::Fetch(FetchItem *)
// Queue the requests
int Depth = -1;
- bool Tail = false;
for (FetchItem *I = Queue; I != 0 && Depth < (signed)PipelineDepth;
I = I->Next, Depth++)
{
@@ -1008,8 +1007,6 @@ bool HttpMethod::Fetch(FetchItem *)
if (Server->Comp(I->Uri) == false)
break;
if (QueueBack == I)
- Tail = true;
- if (Tail == true)
{
QueueBack = I->Next;
SendReq(I,Server->Out);
@@ -1071,7 +1068,6 @@ int HttpMethod::Loop()
delete Server;
Server = new ServerState(Queue->Uri,this);
}
-
/* If the server has explicitly said this is the last connection
then we pre-emptively shut down the pipeline and tear down
the connection. This will speed up HTTP/1.0 servers a tad
@@ -1168,8 +1164,24 @@ int HttpMethod::Loop()
URIDone(Res);
}
else
- Fail(true);
-
+ {
+ if (Server->ServerFd == -1)
+ {
+ FailCounter++;
+ _error->Discard();
+ Server->Close();
+
+ if (FailCounter >= 2)
+ {
+ Fail(_("Connection failed"),true);
+ FailCounter = 0;
+ }
+
+ QueueBack = Queue;
+ }
+ else
+ Fail(true);
+ }
break;
}