From 2f6aed72f656494d668918aa8ce4052d7c81e993 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 25 Oct 2017 21:40:56 +0200 Subject: mark some 500 HTTP codes as transient acquire errors If retries are enabled only transient errors are retried, which are very few errors. At least for some HTTP codes it could be beneficial to retry them through so adding them seems like a good idea if only to be more consistent in what we report. --- methods/basehttp.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/basehttp.cc b/methods/basehttp.cc index c77ab28c6..3b4c60720 100644 --- a/methods/basehttp.cc +++ b/methods/basehttp.cc @@ -801,7 +801,19 @@ int BaseHttpMethod::Loop() case ERROR_WITH_CONTENT_PAGE: { Server->RunDataToDevNull(Req); - Fail(); + constexpr unsigned int TransientCodes[] = { + 408, // Request Timeout + 429, // Too Many Requests + 500, // Internal Server Error + 502, // Bad Gateway + 503, // Service Unavailable + 504, // Gateway Timeout + 599, // Network Connect Timeout Error + }; + if (std::find(std::begin(TransientCodes), std::end(TransientCodes), Req.Result) != std::end(TransientCodes)) + Fail(true); + else + Fail(); break; } -- cgit v1.2.3-70-g09d2