fix: miss header when retry

This commit is contained in:
fly3366 2020-12-22 19:54:04 +08:00 committed by Andrew Gaul
parent a16d00d673
commit 51f65d7b14

View File

@ -2230,17 +2230,18 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
long responseCode; long responseCode;
int result = S3FSCURL_PERFORM_RESULT_NOTSET; int result = S3FSCURL_PERFORM_RESULT_NOTSET;
// 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) { if(!dontAddAuthHeaders) {
insertAuthHeaders(); insertAuthHeaders();
} }
curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders); 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;
// Requests // Requests
CURLcode curlCode = curl_easy_perform(hCurl); CURLcode curlCode = curl_easy_perform(hCurl);