mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-25 14:48:27 +00:00
Fixed build error by cppcheck 1.89
This commit is contained in:
parent
58b3cce320
commit
bedd648d47
@ -168,7 +168,7 @@ void AdditionalHeader::Unload()
|
|||||||
{
|
{
|
||||||
is_enable = false;
|
is_enable = false;
|
||||||
|
|
||||||
for(addheadlist_t::iterator iter = addheadlist.begin(); iter != addheadlist.end(); iter = addheadlist.erase(iter)){
|
for(addheadlist_t::iterator iter = addheadlist.begin(); iter != addheadlist.end(); ++iter){
|
||||||
ADDHEAD *paddhead = *iter;
|
ADDHEAD *paddhead = *iter;
|
||||||
if(paddhead){
|
if(paddhead){
|
||||||
if(paddhead->pregex){
|
if(paddhead->pregex){
|
||||||
@ -178,6 +178,7 @@ void AdditionalHeader::Unload()
|
|||||||
delete paddhead;
|
delete paddhead;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
addheadlist.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdditionalHeader::AddHeader(headers_t& meta, const char* path) const
|
bool AdditionalHeader::AddHeader(headers_t& meta, const char* path) const
|
||||||
|
@ -87,7 +87,7 @@ inline void InitStatCacheTime(struct timespec& ts)
|
|||||||
ts.tv_nsec = 0;
|
ts.tv_nsec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int CompareStatCacheTime(struct timespec& ts1, struct timespec& ts2)
|
inline int CompareStatCacheTime(const struct timespec& ts1, const struct timespec& ts2)
|
||||||
{
|
{
|
||||||
// return -1: ts1 < ts2
|
// return -1: ts1 < ts2
|
||||||
// 0: ts1 == ts2
|
// 0: ts1 == ts2
|
||||||
@ -304,7 +304,7 @@ bool StatCache::GetStat(const string& key, struct stat* pst, headers_t* meta, bo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StatCache::IsNoObjectCache(string& key, bool overcheck)
|
bool StatCache::IsNoObjectCache(const string& key, bool overcheck)
|
||||||
{
|
{
|
||||||
bool is_delete_cache = false;
|
bool is_delete_cache = false;
|
||||||
string strpath = key;
|
string strpath = key;
|
||||||
|
@ -110,7 +110,7 @@ class StatCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cache For no object
|
// Cache For no object
|
||||||
bool IsNoObjectCache(std::string& key, bool overcheck = true);
|
bool IsNoObjectCache(const std::string& key, bool overcheck = true);
|
||||||
bool AddNoObjectCache(std::string& key);
|
bool AddNoObjectCache(std::string& key);
|
||||||
|
|
||||||
// Add stat cache
|
// Add stat cache
|
||||||
|
@ -3420,7 +3420,7 @@ int S3fsCurl::PreMultipartPostRequest(const char* tpath, headers_t& meta, string
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int S3fsCurl::CompleteMultipartPostRequest(const char* tpath, string& upload_id, etaglist_t& parts)
|
int S3fsCurl::CompleteMultipartPostRequest(const char* tpath, const string& upload_id, etaglist_t& parts)
|
||||||
{
|
{
|
||||||
S3FS_PRN_INFO3("[tpath=%s][parts=%zu]", SAFESTRPTR(tpath), parts.size());
|
S3FS_PRN_INFO3("[tpath=%s][parts=%zu]", SAFESTRPTR(tpath), parts.size());
|
||||||
|
|
||||||
@ -3530,7 +3530,7 @@ int S3fsCurl::MultipartListRequest(string& body)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int S3fsCurl::AbortMultipartUpload(const char* tpath, string& upload_id)
|
int S3fsCurl::AbortMultipartUpload(const char* tpath, const string& upload_id)
|
||||||
{
|
{
|
||||||
S3FS_PRN_INFO3("[tpath=%s]", SAFESTRPTR(tpath));
|
S3FS_PRN_INFO3("[tpath=%s]", SAFESTRPTR(tpath));
|
||||||
|
|
||||||
@ -3662,7 +3662,7 @@ int S3fsCurl::UploadMultipartPostRequest(const char* tpath, int part_num, const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int S3fsCurl::CopyMultipartPostSetup(const char* from, const char* to, int part_num, string& upload_id, headers_t& meta)
|
int S3fsCurl::CopyMultipartPostSetup(const char* from, const char* to, int part_num, const string& upload_id, headers_t& meta)
|
||||||
{
|
{
|
||||||
S3FS_PRN_INFO3("[from=%s][to=%s][part=%d]", SAFESTRPTR(from), SAFESTRPTR(to), part_num);
|
S3FS_PRN_INFO3("[from=%s][to=%s][part=%d]", SAFESTRPTR(from), SAFESTRPTR(to), part_num);
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ class S3fsCurl
|
|||||||
int GetIAMCredentials(void);
|
int GetIAMCredentials(void);
|
||||||
|
|
||||||
int UploadMultipartPostSetup(const char* tpath, int part_num, const std::string& upload_id);
|
int UploadMultipartPostSetup(const char* tpath, int part_num, const std::string& upload_id);
|
||||||
int CopyMultipartPostSetup(const char* from, const char* to, int part_num, std::string& upload_id, headers_t& meta);
|
int CopyMultipartPostSetup(const char* from, const char* to, int part_num, const std::string& upload_id, headers_t& meta);
|
||||||
bool UploadMultipartPostComplete();
|
bool UploadMultipartPostComplete();
|
||||||
bool CopyMultipartPostComplete();
|
bool CopyMultipartPostComplete();
|
||||||
|
|
||||||
@ -494,10 +494,10 @@ class S3fsCurl
|
|||||||
int CheckBucket(void);
|
int CheckBucket(void);
|
||||||
int ListBucketRequest(const char* tpath, const char* query);
|
int ListBucketRequest(const char* tpath, const char* query);
|
||||||
int PreMultipartPostRequest(const char* tpath, headers_t& meta, std::string& upload_id, bool is_copy);
|
int PreMultipartPostRequest(const char* tpath, headers_t& meta, std::string& upload_id, bool is_copy);
|
||||||
int CompleteMultipartPostRequest(const char* tpath, std::string& upload_id, etaglist_t& parts);
|
int CompleteMultipartPostRequest(const char* tpath, const std::string& upload_id, etaglist_t& parts);
|
||||||
int UploadMultipartPostRequest(const char* tpath, int part_num, const std::string& upload_id);
|
int UploadMultipartPostRequest(const char* tpath, int part_num, const std::string& upload_id);
|
||||||
int MultipartListRequest(std::string& body);
|
int MultipartListRequest(std::string& body);
|
||||||
int AbortMultipartUpload(const char* tpath, std::string& upload_id);
|
int AbortMultipartUpload(const char* tpath, const std::string& upload_id);
|
||||||
int MultipartHeadRequest(const char* tpath, off_t size, headers_t& meta, bool is_copy);
|
int MultipartHeadRequest(const char* tpath, off_t size, headers_t& meta, bool is_copy);
|
||||||
int MultipartUploadRequest(const char* tpath, headers_t& meta, int fd, bool is_copy);
|
int MultipartUploadRequest(const char* tpath, headers_t& meta, int fd, bool is_copy);
|
||||||
int MultipartUploadRequest(const std::string& upload_id, const char* tpath, int fd, off_t offset, off_t size, etaglist_t& list);
|
int MultipartUploadRequest(const std::string& upload_id, const char* tpath, int fd, off_t offset, off_t size, etaglist_t& list);
|
||||||
|
@ -172,7 +172,7 @@ static int check_parent_object_access(const char* path, int mask);
|
|||||||
static FdEntity* get_local_fent(const char* path, bool is_load = false);
|
static FdEntity* get_local_fent(const char* path, bool is_load = false);
|
||||||
static bool multi_head_callback(S3fsCurl* s3fscurl);
|
static bool multi_head_callback(S3fsCurl* s3fscurl);
|
||||||
static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl);
|
static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl);
|
||||||
static int readdir_multi_head(const char* path, S3ObjList& head, void* buf, fuse_fill_dir_t filler);
|
static int readdir_multi_head(const char* path, const S3ObjList& head, void* buf, fuse_fill_dir_t filler);
|
||||||
static int list_bucket(const char* path, S3ObjList& head, const char* delimiter, bool check_content_only = false);
|
static int list_bucket(const char* path, S3ObjList& head, const char* delimiter, bool check_content_only = false);
|
||||||
static int directory_empty(const char* path);
|
static int directory_empty(const char* path);
|
||||||
static bool is_truncated(xmlDocPtr doc);
|
static bool is_truncated(xmlDocPtr doc);
|
||||||
@ -2440,7 +2440,7 @@ static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl)
|
|||||||
return newcurl;
|
return newcurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int readdir_multi_head(const char* path, S3ObjList& head, void* buf, fuse_fill_dir_t filler)
|
static int readdir_multi_head(const char* path, const S3ObjList& head, void* buf, fuse_fill_dir_t filler)
|
||||||
{
|
{
|
||||||
S3fsMultiCurl curlmulti(S3fsCurl::GetMaxMultiRequest());
|
S3fsMultiCurl curlmulti(S3fsCurl::GetMaxMultiRequest());
|
||||||
s3obj_list_t headlist;
|
s3obj_list_t headlist;
|
||||||
@ -2750,7 +2750,7 @@ static bool GetXmlNsUrl(xmlDocPtr doc, string& nsurl)
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if(!doc){
|
if(!doc){
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
if((tmLast + 60) < time(NULL)){
|
if((tmLast + 60) < time(NULL)){
|
||||||
// refresh
|
// refresh
|
||||||
@ -2877,7 +2877,7 @@ static bool is_truncated(xmlDocPtr doc)
|
|||||||
|
|
||||||
xmlChar* strTruncate = get_base_exp(doc, "IsTruncated");
|
xmlChar* strTruncate = get_base_exp(doc, "IsTruncated");
|
||||||
if(!strTruncate){
|
if(!strTruncate){
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
if(0 == strcasecmp((const char*)strTruncate, "true")){
|
if(0 == strcasecmp((const char*)strTruncate, "true")){
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -994,18 +994,18 @@ bool simple_parse_xml(const char* data, size_t len, const char* key, std::string
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if(!data || !key){
|
if(!data || !key){
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
value.clear();
|
value.clear();
|
||||||
|
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
if(NULL == (doc = xmlReadMemory(data, len, "", NULL, 0))){
|
if(NULL == (doc = xmlReadMemory(data, len, "", NULL, 0))){
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NULL == doc->children){
|
if(NULL == doc->children){
|
||||||
S3FS_XMLFREEDOC(doc);
|
S3FS_XMLFREEDOC(doc);
|
||||||
return result;
|
return false;
|
||||||
}
|
}
|
||||||
for(xmlNodePtr cur_node = doc->children->children; NULL != cur_node; cur_node = cur_node->next){
|
for(xmlNodePtr cur_node = doc->children->children; NULL != cur_node; cur_node = cur_node->next){
|
||||||
// For DEBUG
|
// For DEBUG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user