summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-07-14 16:57:15 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-07-14 16:57:15 +0100
commitf0efdda074effd4b8d668c1adfd6ddc4be698ae9 (patch)
tree448d69dfba458f406850cfd672f4c33fcfce26f1 /methods/http.cc
parenta975773b97214620c750cb2465e01f811a33831d (diff)
parent82d0afc286514bbe8904c3436bb6580aeaa6ad66 (diff)
* 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) *
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 7001b217a..6aa4261ff 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -998,7 +998,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++)
{
@@ -1010,8 +1009,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);
@@ -1073,7 +1070,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
@@ -1170,8 +1166,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;
}