Skip to content

Commit 5c135f4

Browse files
Merge pull request #158 from tencentyun/feature_huberyxxiao_024bd8e2
Feature huberyxxiao 024bd8e2
2 parents 41eeb4a + 9ae64be commit 5c135f4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

include/cos_defines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace qcloud_cos {
1313

14-
#define COS_CPP_SDK_VERSON "v5.5.10"
14+
#define COS_CPP_SDK_VERSON "v5.5.11"
1515

1616
/// 路径分隔符
1717
const std::string kPathDelimiter = "/";

src/cos_sys_config.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ unsigned CosSysConfig::m_dns_cache_expire_seconds = 600;
5757
// dns cache大小
5858
unsigned CosSysConfig::m_dns_cache_size = 1000;
5959

60-
bool CosSysConfig::m_retry_change_domain = true;
60+
bool CosSysConfig::m_retry_change_domain = false;
6161

6262
std::mutex m_intranet_addr_lock;
6363
std::mutex m_dest_domain_lock;

src/op/object_op.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2017, Tencent Inc.
1+
// Copyright (c) 2017, Tencent Inc.
22
// All rights reserved.
33
//
44
// Author: sevenyou <[email protected]>
@@ -337,7 +337,11 @@ CosResult ObjectOp::HeadObject(const HeadObjectReq& req, HeadObjectResp* resp, b
337337
std::string host = CosSysConfig::GetHost(GetAppId(), m_config->GetRegion(),
338338
req.GetBucketName(),change_backup_domain);
339339
std::string path = req.GetPath();
340-
return NormalAction(host, path, req, "", false, resp);
340+
CosResult result = NormalAction(host, path, req, "", false, resp);
341+
if (result.GetHttpStatus() == 404){
342+
result.SetErrorCode("NoSuchKey");
343+
}
344+
return result;
341345
}
342346

343347
CosResult ObjectOp::GetObject(const GetObjectByStreamReq& req,
@@ -1781,6 +1785,9 @@ void ObjectOp::FillCopyTask(const std::string& upload_id,
17811785
}
17821786

17831787
std::string ObjectOp::GeneratePresignedUrl(const GeneratePresignedUrlReq& req) {
1788+
if (req.GetObjectName().empty()) {
1789+
return "ObjectName does not support empty, please check!";
1790+
}
17841791
std::string auth_str = "";
17851792

17861793
std::string host;

0 commit comments

Comments
 (0)