]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Send HTTP/500 (Internal Server Error) when lacking peers (#490)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Wed, 27 Nov 2019 03:30:34 +0000 (03:30 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 27 Nov 2019 06:25:18 +0000 (06:25 +0000)
... 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.

src/tunnel.cc

index 519ac43a7774eb7efb1e60332e2077e903567f06..d510c91111f31277764eec9d6cd2fd079480daca 100644 (file)
@@ -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;