Move the connection back to the connection pool when HTTP error 404 was received (#5308)

* Move the connection back to the connection pool when HTTP error 404 was received

* Use symbolic name for 404 status code
This commit is contained in:
Mykhailo Chelnokov 2024-02-03 00:10:58 +02:00 committed by GitHub
parent 807b6c946a
commit 79cc06d004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2132,8 +2132,7 @@ void CurlConnectionPool::MoveConnectionBackToPool(
HttpStatusCode lastStatusCode)
{
auto code = static_cast<std::underlying_type<Http::HttpStatusCode>::type>(lastStatusCode);
// laststatusCode = 0
if (code < 200 || code >= 300)
if ((code < 200 || code >= 300) && lastStatusCode != HttpStatusCode::NotFound)
{
// A handler with previous response with Error can't be re-use.
return;