summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorbubulle@debian.org <>2007-07-15 08:17:44 +0200
committerbubulle@debian.org <>2007-07-15 08:17:44 +0200
commit5ffd03998b01c174298ddb3f2f914f59bdee7481 (patch)
tree053148d6cef4f862101f30de584cae0bb5048757 /methods/http.cc
parentd59821362ed1032920a72d3795176cccadaea6b0 (diff)
parent82d0afc286514bbe8904c3436bb6580aeaa6ad66 (diff)
Sync with Michael
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;
}