Skip to content

Commit

Permalink
Test 08
Browse files Browse the repository at this point in the history
  • Loading branch information
ggtakec committed May 14, 2024
1 parent 7f48033 commit 615d2f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
41 changes: 0 additions & 41 deletions src/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ constexpr char S3fsCurl::S3FS_SSL_PRIVKEY_PASSWORD[];
pthread_mutex_t S3fsCurl::curl_warnings_lock;
pthread_mutex_t S3fsCurl::curl_handles_lock;
//TEST
pthread_mutex_t S3fsCurl::test_lock;
//TEST
//TEST
//S3fsCurl::callback_locks_t S3fsCurl::callback_locks;
pthread_mutex_t S3fsCurl::callback_locks[CURL_LOCK_DATA_LAST];
//TEST
Expand Down Expand Up @@ -161,11 +158,6 @@ bool S3fsCurl::InitS3fsCurl()
if(0 != pthread_mutex_init(&S3fsCurl::curl_handles_lock, &attr)){
return false;
}
//TEST
if(0 != pthread_mutex_init(&S3fsCurl::test_lock, &attr)){
return false;
}
//TEST
//TEST
// if(0 != pthread_mutex_init(&S3fsCurl::callback_locks.dns, &attr)){
// return false;
Expand Down Expand Up @@ -233,11 +225,6 @@ bool S3fsCurl::DestroyS3fsCurl()
return false;
}
}
//TEST
//TEST
if(0 != pthread_mutex_destroy(&S3fsCurl::test_lock)){
result = false;
}
//TEST
if(0 != pthread_mutex_destroy(&S3fsCurl::curl_handles_lock)){
result = false;
Expand Down Expand Up @@ -2678,16 +2665,6 @@ bool S3fsCurl::RemakeHandle()
//
int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
{
//TEST
int my_counter;
{
AutoLock lock(&S3fsCurl::test_lock);

static int common_counter = 0;
my_counter = ++common_counter;
}
//TEST

if(S3fsLog::IsS3fsLogDbg()){
char* ptr_url = nullptr;
curl_easy_getinfo(hCurl, CURLINFO_EFFECTIVE_URL , &ptr_url);
Expand All @@ -2708,41 +2685,23 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
insertAuthHeaders();
}

//TEST
S3FS_PRN_DBG("++++++++ START : BEFORE SETOPT : PASS (%d)", my_counter);
//TEST
if(CURLE_OK != curl_easy_setopt(hCurl, CURLOPT_HTTPHEADER, requestHeaders)){
return false;
}
//TEST
S3FS_PRN_DBG("++++++++ END : AFTER SETOPT : PASS (%d)", my_counter);
//TEST

// Requests
//TEST
S3FS_PRN_DBG("++++++++ START : BEFORE REFORM : PASS (%d)", my_counter);
//TEST
curlCode = curl_easy_perform(hCurl);
//TEST
S3FS_PRN_DBG("++++++++ END : AFTER REFORM : PASS (%d)", my_counter);
//TEST

// Check result
switch(curlCode){
case CURLE_OK:
// Need to look at the HTTP response code
//TEST
S3FS_PRN_DBG("++++++++ START : BEFORE GETINFO : PASS (%d)", my_counter);
//TEST
if(0 != curl_easy_getinfo(hCurl, CURLINFO_RESPONSE_CODE, &responseCode)){
S3FS_PRN_ERR("curl_easy_getinfo failed while trying to retrieve HTTP response code");
responseCode = S3FSCURL_RESPONSECODE_FATAL_ERROR;
result = -EIO;
break;
}
//TEST
S3FS_PRN_DBG("++++++++ END : AFTER GETINFO : PASS (%d)", my_counter);
//TEST
if(responseCode >= 200 && responseCode < 300){
S3FS_PRN_INFO3("HTTP response code %ld", responseCode);
result = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ class S3fsCurl
static pthread_mutex_t curl_warnings_lock;
static bool curl_warnings_once; // emit older curl warnings only once
static pthread_mutex_t curl_handles_lock;
//TEST
static pthread_mutex_t test_lock;
//TEST
//TEST
// static struct callback_locks_t {
// pthread_mutex_t dns;
Expand Down

0 comments on commit 615d2f0

Please sign in to comment.