From d62b0d66690a57f42c0104c4acfeaf82b92f2858 Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:08:34 -0700 Subject: [PATCH] Revert "Move the connection back to the connection pool when HTTP error 404 was received (#5308)" (#5472) * Revert "Move the connection back to the connection pool when HTTP error 404 was received (#5308)" This reverts commit 79cc06d004a7f8dfdc3ebcf65f0f8498b6b3e613. * Changelog --------- Co-authored-by: Anton Kolesnyk --- sdk/core/azure-core/CHANGELOG.md | 1 + sdk/core/azure-core/src/http/curl/curl.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 5a2d79cf6..5d84c0a47 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bugs Fixed +- [[#5450]](https://github.com/Azure/azure-sdk-for-cpp/issues/5450) Reverted libcurl connection pool to use more conservative caching strategy. - [[#4352]](https://github.com/Azure/azure-sdk-for-cpp/pull/5371) Fixed compilation error on Visual Studio 2017. (A community contribution, courtesy of _[morten-ofstad](https://github.com/morten-ofstad)_) ### Acknowledgments diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 428ba9417..0a3b81481 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -2132,7 +2132,8 @@ void CurlConnectionPool::MoveConnectionBackToPool( HttpStatusCode lastStatusCode) { auto code = static_cast::type>(lastStatusCode); - if ((code < 200 || code >= 300) && lastStatusCode != HttpStatusCode::NotFound) + // laststatusCode = 0 + if (code < 200 || code >= 300) { // A handler with previous response with Error can't be re-use. return;