From 75a07f5b6e64c5ae8eb986d9fb4350c63fe7734a Mon Sep 17 00:00:00 2001 From: Ypatia Tsavliri Date: Wed, 4 Sep 2024 10:10:59 +0300 Subject: [PATCH] Update tiledb/sm/rest/curl.cc Co-authored-by: Shaun M Reed --- tiledb/sm/rest/curl.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tiledb/sm/rest/curl.cc b/tiledb/sm/rest/curl.cc index fd70c54344c..ca16bfa3118 100644 --- a/tiledb/sm/rest/curl.cc +++ b/tiledb/sm/rest/curl.cc @@ -324,9 +324,8 @@ Status Curl::init( "rest.curl.buffer_size", &curl_buffer_size_, &found)); assert(found); - RETURN_NOT_OK(config_->get( - "rest.curl.retry_errors", &retry_curl_errors_, &found)); - assert(found); + retry_curl_errors_ = + config_->get("rest.curl.retry_errors", Config::must_find); return Status::Ok(); } @@ -563,7 +562,7 @@ Status Curl::make_curl_request_common( CURLcode tmp_curl_code = curl_easy_perform_instrumented(url, i); long http_code = 0; - if (tmp_curl_code != CURLE_OK) { + if (tmp_curl_code == CURLE_OK) { if (curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code) != CURLE_OK) { return LOG_STATUS(Status_RestError( @@ -772,11 +771,6 @@ bool Curl::should_retry_based_on_curl_code(CURLcode curl_code) const { } bool Curl::should_retry_request(CURLcode curl_code, long http_code) const { - CURL* curl = curl_.get(); - if (curl == nullptr) - throw std::runtime_error( - "Cannot make curl request; curl instance is null."); - if (curl_code != CURLE_OK) { return should_retry_based_on_curl_code(curl_code); } else {