From: Eduard Bagdasaryan Date: Wed, 27 Nov 2019 03:30:34 +0000 (+0000) Subject: Send HTTP/500 (Internal Server Error) when lacking peers (#490) X-Git-Tag: SQUID_5_0_1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d55f01c1b9f3185c6fa7158a85e3b58939887b1;p=thirdparty%2Fsquid.git Send HTTP/500 (Internal Server Error) when lacking peers (#490) ... instead of sending HTTP/503 (Service Unavailable) in tunneling cases. Tunneling code reported 503 while regular forwarding code reported 500 errors under identical "no peers to try" circumstances. For consistency sake, we need to use one of these codes in both places. We considered and rejected 503 because RFC7231 limits its usage to several specific cases, not including 'lacking peers' case. --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 519ac43a77..d510c91111 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1078,7 +1078,7 @@ TunnelStateData::noteDestinationsEnd(ErrorState *selectionError) if (savedError) return sendError(savedError, "all found paths have failed"); - return sendError(new ErrorState(ERR_CANNOT_FORWARD, Http::scServiceUnavailable, request.getRaw(), al), + return sendError(new ErrorState(ERR_CANNOT_FORWARD, Http::scInternalServerError, request.getRaw(), al), "path selection found no paths"); } // else continue to use one of the previously noted destinations;