From 8734da2b6868d4f73759d4473ea52637541efce9 Mon Sep 17 00:00:00 2001 From: Evan Zelkowitz Date: Tue, 5 Jan 2021 21:30:13 +0000 Subject: [PATCH] Fix issue with unavailable server retry codes Currently when populating the list it checks for >500, this should be 499 to not exclude `500` Also adding warnings during token parsing to notify if a user has added an erroneous err code to the unavailable or simple codes list --- proxy/ParentSelection.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc index 08254a453d8..61706b0eba5 100644 --- a/proxy/ParentSelection.cc +++ b/proxy/ParentSelection.cc @@ -332,15 +332,17 @@ UnavailableServerResponseCodes::UnavailableServerResponseCodes(char *val) numTok = pTok.Initialize(val, SHARE_TOKS); if (numTok == 0) { c = atoi(val); - if (c > 500 && c < 600) { + if (c > 499 && c < 600) { codes.push_back(HTTP_STATUS_SERVICE_UNAVAILABLE); } } for (int i = 0; i < numTok; i++) { c = atoi(pTok[i]); - if (c > 500 && c < 600) { + if (c > 499 && c < 600) { Debug("parent_select", "loading response code: %d", c); codes.push_back(c); + } else { + Warning("UnavailableServerResponseCodes received non-5xx code '%s', ignoring!", pTok[i]); } } std::sort(codes.begin(), codes.end()); @@ -368,6 +370,8 @@ SimpleRetryResponseCodes::SimpleRetryResponseCodes(char *val) if (c > 399 && c < 500) { Debug("parent_select", "loading simple response code: %d", c); codes.push_back(c); + } else { + Warning("SimpleRetryResponseCodes received non-4xx code '%s', ignoring!", pTok[i]); } } std::sort(codes.begin(), codes.end());