mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-02-02 18:48:26 +00:00
break recursion when calling GetIAMCredentials (#1233)
break recursion when calling GetIAMCredentials
This commit is contained in:
parent
7135666060
commit
4e26728cbf
11
src/curl.cpp
11
src/curl.cpp
@ -2372,7 +2372,7 @@ bool S3fsCurl::RemakeHandle()
|
|||||||
//
|
//
|
||||||
// returns curl return code
|
// returns curl return code
|
||||||
//
|
//
|
||||||
int S3fsCurl::RequestPerform()
|
int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
|
||||||
{
|
{
|
||||||
if(IS_S3FS_LOG_DBG()){
|
if(IS_S3FS_LOG_DBG()){
|
||||||
char* ptr_url = NULL;
|
char* ptr_url = NULL;
|
||||||
@ -2384,7 +2384,10 @@ int S3fsCurl::RequestPerform()
|
|||||||
long responseCode;
|
long responseCode;
|
||||||
int result = S3FSCURL_PERFORM_RESULT_NOTSET;
|
int result = S3FSCURL_PERFORM_RESULT_NOTSET;
|
||||||
|
|
||||||
insertAuthHeaders();
|
if(!dontAddAuthHeaders) {
|
||||||
|
insertAuthHeaders();
|
||||||
|
}
|
||||||
|
|
||||||
curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders);
|
curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders);
|
||||||
|
|
||||||
// 1 attempt + retries...
|
// 1 attempt + retries...
|
||||||
@ -2907,7 +2910,7 @@ int S3fsCurl::GetIAMCredentials()
|
|||||||
curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
||||||
S3fsCurl::AddUserAgent(hCurl); // put User-Agent
|
S3fsCurl::AddUserAgent(hCurl); // put User-Agent
|
||||||
|
|
||||||
int result = RequestPerform();
|
int result = RequestPerform(true);
|
||||||
|
|
||||||
// analyzing response
|
// analyzing response
|
||||||
if(0 == result && !S3fsCurl::SetIAMCredentials(bodydata.str())){
|
if(0 == result && !S3fsCurl::SetIAMCredentials(bodydata.str())){
|
||||||
@ -2944,7 +2947,7 @@ bool S3fsCurl::LoadIAMRoleFromMetaData()
|
|||||||
curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
||||||
S3fsCurl::AddUserAgent(hCurl); // put User-Agent
|
S3fsCurl::AddUserAgent(hCurl); // put User-Agent
|
||||||
|
|
||||||
int result = RequestPerform();
|
int result = RequestPerform(true);
|
||||||
|
|
||||||
// analyzing response
|
// analyzing response
|
||||||
if(0 == result && !S3fsCurl::SetIAMRoleFromMetaData(bodydata.str())){
|
if(0 == result && !S3fsCurl::SetIAMRoleFromMetaData(bodydata.str())){
|
||||||
|
@ -489,7 +489,7 @@ class S3fsCurl
|
|||||||
bool LoadIAMRoleFromMetaData(void);
|
bool LoadIAMRoleFromMetaData(void);
|
||||||
bool AddSseRequestHead(sse_type_t ssetype, std::string& ssevalue, bool is_only_c, bool is_copy);
|
bool AddSseRequestHead(sse_type_t ssetype, std::string& ssevalue, bool is_only_c, bool is_copy);
|
||||||
bool GetResponseCode(long& responseCode, bool from_curl_handle = true);
|
bool GetResponseCode(long& responseCode, bool from_curl_handle = true);
|
||||||
int RequestPerform(void);
|
int RequestPerform(bool dontAddAuthHeaders=false);
|
||||||
int DeleteRequest(const char* tpath);
|
int DeleteRequest(const char* tpath);
|
||||||
bool PreHeadRequest(const char* tpath, const char* bpath = NULL, const char* savedpath = NULL, int ssekey_pos = -1);
|
bool PreHeadRequest(const char* tpath, const char* bpath = NULL, const char* savedpath = NULL, int ssekey_pos = -1);
|
||||||
bool PreHeadRequest(std::string& tpath, std::string& bpath, std::string& savedpath, int ssekey_pos = -1) {
|
bool PreHeadRequest(std::string& tpath, std::string& bpath, std::string& savedpath, int ssekey_pos = -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user