summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 506e66fae..068d26978 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -1164,8 +1164,25 @@ 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;
}