From 51f65d7b1421dd3571794b71193c1a516d3cd305 Mon Sep 17 00:00:00 2001 From: fly3366 <38378045+fly3366@users.noreply.github.com> Date: Tue, 22 Dec 2020 19:54:04 +0800 Subject: [PATCH] fix: miss header when retry --- src/curl.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index 4adea0c..4dbff45 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2230,16 +2230,17 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/) long responseCode; int result = S3FSCURL_PERFORM_RESULT_NOTSET; - if(!dontAddAuthHeaders) { - insertAuthHeaders(); - } - - curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders); - // 1 attempt + retries... for(int retrycnt = 0; S3FSCURL_PERFORM_RESULT_NOTSET == result && retrycnt < S3fsCurl::retries; ++retrycnt){ // Reset response code responseCode = S3FSCURL_RESPONSECODE_NOTSET; + + // Insert headers + if(!dontAddAuthHeaders) { + insertAuthHeaders(); + } + + curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders); // Requests CURLcode curlCode = curl_easy_perform(hCurl);