Fixed a bug(failed all multi head request when mounting bucket+path)

1) Fixes a bug
    When the mount point is specified with sub-directory(mounting with 
    "bucket:/path"), internally all curl_multi head request in s3fs_readdir() 
    function failed.
    This reason is that the head curl_multi request is not specified with 
    mount path.
    This is a bug, and fixed.



git-svn-id: http://s3fs.googlecode.com/svn/trunk@431 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
ggtakec@gmail.com 2013-05-27 02:22:47 +00:00
parent 7aa11f389a
commit 2d51439dcb

View File

@ -39,11 +39,13 @@
#include <string> #include <string>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <list>
#include "common.h" #include "common.h"
#include "curl.h" #include "curl.h"
#include "string_util.h" #include "string_util.h"
#include "s3fs.h" #include "s3fs.h"
#include "s3fs_util.h"
using namespace std; using namespace std;
@ -378,9 +380,10 @@ int curl_get_headers(const char *path, headers_t &meta)
CURL *create_head_handle(head_data *request_data) CURL *create_head_handle(head_data *request_data)
{ {
CURL *curl_handle = create_curl_handle(); CURL *curl_handle= create_curl_handle();
string resource = urlEncode(service_path + bucket + request_data->path); string realpath = get_realpath(request_data->path.c_str());
string url = host + resource; string resource = urlEncode(service_path + bucket + realpath);
string url = host + resource;
// libcurl 7.17 does deep copy of url, deep copy "stable" url // libcurl 7.17 does deep copy of url, deep copy "stable" url
string my_url = prepare_url(url.c_str()); string my_url = prepare_url(url.c_str());