mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-18 10:15:13 +00:00
parent
f9f614a474
commit
3928a7e359
@ -803,7 +803,7 @@ bool S3fsCurl::PushbackSseKeys(const std::string& input)
|
|||||||
} else {
|
} else {
|
||||||
char* pbase64_key;
|
char* pbase64_key;
|
||||||
|
|
||||||
if(NULL != (pbase64_key = s3fs_base64(reinterpret_cast<unsigned char*>(const_cast<char*>(onekey.c_str())), onekey.length()))) {
|
if(NULL != (pbase64_key = s3fs_base64(reinterpret_cast<const unsigned char*>(onekey.c_str()), onekey.length()))) {
|
||||||
raw_key = onekey;
|
raw_key = onekey;
|
||||||
base64_key = pbase64_key;
|
base64_key = pbase64_key;
|
||||||
delete[] pbase64_key;
|
delete[] pbase64_key;
|
||||||
|
@ -770,7 +770,7 @@ bool FdEntity::RenamePath(const std::string& newpath, std::string& fentmapkey)
|
|||||||
|
|
||||||
bool FdEntity::IsModified() const
|
bool FdEntity::IsModified() const
|
||||||
{
|
{
|
||||||
AutoLock auto_data_lock(const_cast<pthread_mutex_t *>(&fdent_data_lock));
|
AutoLock auto_data_lock(&fdent_data_lock);
|
||||||
return pagelist.IsModified();
|
return pagelist.IsModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class FdEntity
|
|||||||
headers_t orgmeta; // original headers at opening
|
headers_t orgmeta; // original headers at opening
|
||||||
off_t size_orgmeta; // original file size in original headers
|
off_t size_orgmeta; // original file size in original headers
|
||||||
|
|
||||||
pthread_mutex_t fdent_data_lock;// protects the following members
|
mutable pthread_mutex_t fdent_data_lock;// protects the following members
|
||||||
PageList pagelist;
|
PageList pagelist;
|
||||||
std::string cachepath; // local cache file path
|
std::string cachepath; // local cache file path
|
||||||
// (if this is empty, does not load/save pagelist.)
|
// (if this is empty, does not load/save pagelist.)
|
||||||
|
@ -3759,6 +3759,7 @@ static bool set_mountpoint_attribute(struct stat& mpst)
|
|||||||
//
|
//
|
||||||
static int set_bucket(const char* arg)
|
static int set_bucket(const char* arg)
|
||||||
{
|
{
|
||||||
|
// TODO: Mutates input. Consider some other tokenization.
|
||||||
char *bucket_name = const_cast<char*>(arg);
|
char *bucket_name = const_cast<char*>(arg);
|
||||||
if(strstr(arg, ":")){
|
if(strstr(arg, ":")){
|
||||||
if(strstr(arg, "://")){
|
if(strstr(arg, "://")){
|
||||||
|
@ -94,7 +94,7 @@ static xmlChar* get_base_exp(xmlDocPtr doc, const char* exp)
|
|||||||
xmlXPathContextPtr ctx = xmlXPathNewContext(doc);
|
xmlXPathContextPtr ctx = xmlXPathNewContext(doc);
|
||||||
|
|
||||||
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
||||||
xmlXPathRegisterNs(ctx, reinterpret_cast<xmlChar*>(const_cast<char*>("s3")), reinterpret_cast<xmlChar*>(const_cast<char*>(xmlnsurl.c_str())));
|
xmlXPathRegisterNs(ctx, reinterpret_cast<const xmlChar*>("s3"), reinterpret_cast<const xmlChar*>(xmlnsurl.c_str()));
|
||||||
exp_string = "/s3:ListBucketResult/s3:";
|
exp_string = "/s3:ListBucketResult/s3:";
|
||||||
} else {
|
} else {
|
||||||
exp_string = "/ListBucketResult/";
|
exp_string = "/ListBucketResult/";
|
||||||
@ -102,7 +102,7 @@ static xmlChar* get_base_exp(xmlDocPtr doc, const char* exp)
|
|||||||
|
|
||||||
exp_string += exp;
|
exp_string += exp;
|
||||||
|
|
||||||
if(NULL == (marker_xp = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(exp_string.c_str())), ctx))){
|
if(NULL == (marker_xp = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(exp_string.c_str()), ctx))){
|
||||||
xmlXPathFreeContext(ctx);
|
xmlXPathFreeContext(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ static xmlChar* get_exp_value_xml(xmlDocPtr doc, xmlXPathContextPtr ctx, const c
|
|||||||
xmlChar* exp_value;
|
xmlChar* exp_value;
|
||||||
|
|
||||||
// search exp_key tag
|
// search exp_key tag
|
||||||
if(NULL == (exp = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(exp_key)), ctx))){
|
if(NULL == (exp = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(exp_key), ctx))){
|
||||||
S3FS_PRN_ERR("Could not find key(%s).", exp_key);
|
S3FS_PRN_ERR("Could not find key(%s).", exp_key);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -253,7 +253,7 @@ bool get_incomp_mpu_list(xmlDocPtr doc, incomp_mpu_list_t& list)
|
|||||||
std::string ex_date;
|
std::string ex_date;
|
||||||
|
|
||||||
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
||||||
xmlXPathRegisterNs(ctx, reinterpret_cast<xmlChar*>(const_cast<char*>("s3")), reinterpret_cast<xmlChar*>(const_cast<char*>(xmlnsurl.c_str())));
|
xmlXPathRegisterNs(ctx, reinterpret_cast<const xmlChar*>("s3"), reinterpret_cast<const xmlChar*>(xmlnsurl.c_str()));
|
||||||
ex_upload += "s3:";
|
ex_upload += "s3:";
|
||||||
ex_key += "s3:";
|
ex_key += "s3:";
|
||||||
ex_id += "s3:";
|
ex_id += "s3:";
|
||||||
@ -266,7 +266,7 @@ bool get_incomp_mpu_list(xmlDocPtr doc, incomp_mpu_list_t& list)
|
|||||||
|
|
||||||
// get "Upload" Tags
|
// get "Upload" Tags
|
||||||
xmlXPathObjectPtr upload_xp;
|
xmlXPathObjectPtr upload_xp;
|
||||||
if(NULL == (upload_xp = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(ex_upload.c_str())), ctx))){
|
if(NULL == (upload_xp = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(ex_upload.c_str()), ctx))){
|
||||||
S3FS_PRN_ERR("xmlXPathEvalExpression returns null.");
|
S3FS_PRN_ERR("xmlXPathEvalExpression returns null.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -342,7 +342,7 @@ int append_objects_from_xml_ex(const char* path, xmlDocPtr doc, xmlXPathContextP
|
|||||||
xmlXPathObjectPtr contents_xp;
|
xmlXPathObjectPtr contents_xp;
|
||||||
xmlNodeSetPtr content_nodes;
|
xmlNodeSetPtr content_nodes;
|
||||||
|
|
||||||
if(NULL == (contents_xp = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(ex_contents)), ctx))){
|
if(NULL == (contents_xp = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(ex_contents), ctx))){
|
||||||
S3FS_PRN_ERR("xmlXPathEvalExpression returns null.");
|
S3FS_PRN_ERR("xmlXPathEvalExpression returns null.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@ int append_objects_from_xml_ex(const char* path, xmlDocPtr doc, xmlXPathContextP
|
|||||||
|
|
||||||
// object name
|
// object name
|
||||||
xmlXPathObjectPtr key;
|
xmlXPathObjectPtr key;
|
||||||
if(NULL == (key = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(ex_key)), ctx))){
|
if(NULL == (key = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(ex_key), ctx))){
|
||||||
S3FS_PRN_WARN("key is null. but continue.");
|
S3FS_PRN_WARN("key is null. but continue.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -383,7 +383,7 @@ int append_objects_from_xml_ex(const char* path, xmlDocPtr doc, xmlXPathContextP
|
|||||||
if(!isCPrefix && ex_etag){
|
if(!isCPrefix && ex_etag){
|
||||||
// Get ETag
|
// Get ETag
|
||||||
xmlXPathObjectPtr ETag;
|
xmlXPathObjectPtr ETag;
|
||||||
if(NULL != (ETag = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(const_cast<char*>(ex_etag)), ctx))){
|
if(NULL != (ETag = xmlXPathEvalExpression(reinterpret_cast<const xmlChar*>(ex_etag), ctx))){
|
||||||
if(xmlXPathNodeSetIsEmpty(ETag->nodesetval)){
|
if(xmlXPathNodeSetIsEmpty(ETag->nodesetval)){
|
||||||
S3FS_PRN_INFO("ETag->nodesetval is empty.");
|
S3FS_PRN_INFO("ETag->nodesetval is empty.");
|
||||||
}else{
|
}else{
|
||||||
@ -439,7 +439,7 @@ int append_objects_from_xml(const char* path, xmlDocPtr doc, S3ObjList& head)
|
|||||||
xmlXPathContextPtr ctx = xmlXPathNewContext(doc);
|
xmlXPathContextPtr ctx = xmlXPathNewContext(doc);
|
||||||
|
|
||||||
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
|
||||||
xmlXPathRegisterNs(ctx, reinterpret_cast<xmlChar*>(const_cast<char*>("s3")), reinterpret_cast<xmlChar*>(const_cast<char*>(xmlnsurl.c_str())));
|
xmlXPathRegisterNs(ctx, reinterpret_cast<const xmlChar*>("s3"), reinterpret_cast<const xmlChar*>(xmlnsurl.c_str()));
|
||||||
ex_contents+= "s3:";
|
ex_contents+= "s3:";
|
||||||
ex_key += "s3:";
|
ex_key += "s3:";
|
||||||
ex_cprefix += "s3:";
|
ex_cprefix += "s3:";
|
||||||
|
Loading…
Reference in New Issue
Block a user