diff --git a/include/cos_defines.h b/include/cos_defines.h index d29fdb8..5871d91 100644 --- a/include/cos_defines.h +++ b/include/cos_defines.h @@ -11,7 +11,7 @@ namespace qcloud_cos { -#define COS_CPP_SDK_VERSON "v5.5.10" +#define COS_CPP_SDK_VERSON "v5.5.11" /// 路径分隔符 const std::string kPathDelimiter = "/"; diff --git a/src/cos_sys_config.cpp b/src/cos_sys_config.cpp index c81ba0a..5d2bec5 100644 --- a/src/cos_sys_config.cpp +++ b/src/cos_sys_config.cpp @@ -57,7 +57,7 @@ unsigned CosSysConfig::m_dns_cache_expire_seconds = 600; // dns cache大小 unsigned CosSysConfig::m_dns_cache_size = 1000; -bool CosSysConfig::m_retry_change_domain = true; +bool CosSysConfig::m_retry_change_domain = false; std::mutex m_intranet_addr_lock; std::mutex m_dest_domain_lock; diff --git a/src/op/object_op.cpp b/src/op/object_op.cpp index 40b61d6..30271bd 100644 --- a/src/op/object_op.cpp +++ b/src/op/object_op.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017, Tencent Inc. +// Copyright (c) 2017, Tencent Inc. // All rights reserved. // // Author: sevenyou @@ -337,7 +337,11 @@ CosResult ObjectOp::HeadObject(const HeadObjectReq& req, HeadObjectResp* resp, b std::string host = CosSysConfig::GetHost(GetAppId(), m_config->GetRegion(), req.GetBucketName(),change_backup_domain); std::string path = req.GetPath(); - return NormalAction(host, path, req, "", false, resp); + CosResult result = NormalAction(host, path, req, "", false, resp); + if (result.GetHttpStatus() == 404){ + result.SetErrorCode("NoSuchKey"); + } + return result; } CosResult ObjectOp::GetObject(const GetObjectByStreamReq& req, @@ -1781,6 +1785,9 @@ void ObjectOp::FillCopyTask(const std::string& upload_id, } std::string ObjectOp::GeneratePresignedUrl(const GeneratePresignedUrlReq& req) { + if (req.GetObjectName().empty()) { + return "ObjectName does not support empty, please check!"; + } std::string auth_str = ""; std::string host;