mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-22 13:28:25 +00:00
Fixed Issue 235, Issue 257, Issue 265
1) Fixes "SSL connect error"(curl 35 error) Fixed "SSL connect error", then s3fs can connect by SSL with no problem. git-svn-id: http://s3fs.googlecode.com/svn/trunk@434 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
29326b048e
commit
1758bc59f4
15
src/curl.cpp
15
src/curl.cpp
@ -155,6 +155,21 @@ int destroy_curl_handles_mutex(void)
|
||||
return pthread_mutex_destroy(&curl_handles_lock);
|
||||
}
|
||||
|
||||
bool init_curl_global_all(void)
|
||||
{
|
||||
if(CURLE_OK != curl_global_init(CURL_GLOBAL_ALL)){
|
||||
FGPRINT("init_curl_global_all returns error.\n");
|
||||
SYSLOGERR("init_curl_global_all returns error.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void cleanup_curl_global_all(void)
|
||||
{
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
static void lock_curl_share(CURL* handle, curl_lock_data nLockData, curl_lock_access laccess, void* useptr)
|
||||
{
|
||||
if(hCurlShare && CURL_LOCK_DATA_DNS == nLockData){
|
||||
|
@ -115,6 +115,8 @@ class auto_head {
|
||||
//
|
||||
int init_curl_handles_mutex(void);
|
||||
int destroy_curl_handles_mutex(void);
|
||||
bool init_curl_global_all(void);
|
||||
void cleanup_curl_global_all(void);
|
||||
int init_curl_share(bool isCache);
|
||||
int destroy_curl_share(bool isCache);
|
||||
void my_set_curl_share(CURL* curl);
|
||||
|
12
src/s3fs.cpp
12
src/s3fs.cpp
@ -4471,9 +4471,15 @@ int main(int argc, char *argv[]) {
|
||||
// exists. skip check if mounting a public bucket
|
||||
if(public_bucket.substr(0,1) != "1"){
|
||||
int result;
|
||||
// Initiate curl global for ssl.
|
||||
if(!init_curl_global_all()){
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if(EXIT_SUCCESS != (result = s3fs_check_service())){
|
||||
cleanup_curl_global_all();
|
||||
exit(result);
|
||||
}
|
||||
cleanup_curl_global_all();
|
||||
}
|
||||
|
||||
if (utility_mode) {
|
||||
@ -4515,9 +4521,15 @@ int main(int argc, char *argv[]) {
|
||||
s3fs_oper.access = s3fs_access;
|
||||
s3fs_oper.create = s3fs_create;
|
||||
|
||||
// Re-Initiate curl global for ssl before calling fuse.
|
||||
if(!init_curl_global_all()){
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// now passing things off to fuse, fuse will finish evaluating the command line args
|
||||
fuse_res = fuse_main(custom_args.argc, custom_args.argv, &s3fs_oper, NULL);
|
||||
fuse_opt_free_args(&custom_args);
|
||||
cleanup_curl_global_all();
|
||||
|
||||
exit(fuse_res);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user