@@ -54,10 +54,15 @@ bool ObjectOp::IsObjectExist(const std::string& bucket_name,
5454 return false ;
5555}
5656
57- std::string ObjectOp::GetResumableUploadID (const std::string& bucket_name,
57+ std::string ObjectOp::GetResumableUploadID (const PutObjectByFileReq& originReq,
58+ const std::string& bucket_name,
5859 const std::string& object_name) {
5960 ListMultipartUploadReq req (bucket_name);
6061 req.SetPrefix (object_name);
62+ if (originReq.IsHttps ()) {
63+ req.SetHttps ();
64+ req.SetCaLocation (originReq.GetCaLocation ());
65+ }
6166 ListMultipartUploadResp resp;
6267
6368 std::string host = CosSysConfig::GetHost (GetAppId (), m_config->GetRegion (),
@@ -184,6 +189,10 @@ bool ObjectOp::CheckUploadPart(const PutObjectByFileReq& req,
184189
185190 while (!list_over_flag) {
186191 std::string marker = StringUtil::IntToString (part_num_marker);
192+ if (req.IsHttps ()){
193+ list_req.SetHttps ();
194+ list_req.SetCaLocation (req.GetCaLocation ());
195+ }
187196 list_req.SetPartNumberMarker (marker);
188197 CosResult result = ListParts (list_req, &resp);
189198 // Add to the parts_info;
@@ -553,7 +562,7 @@ CosResult ObjectOp::MultiUploadObject(const PutObjectByFileReq& req,
553562 bool resume_flag = false ;
554563 std::vector<std::string> already_exist_parts (kMaxPartNumbers );
555564 // check the breakpoint
556- std::string resume_uploadid = GetResumableUploadID (bucket_name, object_name);
565+ std::string resume_uploadid = GetResumableUploadID (req , bucket_name, object_name);
557566 if (!resume_uploadid.empty ()) {
558567 resume_flag = CheckUploadPart (req, bucket_name, object_name,
559568 resume_uploadid, already_exist_parts);
@@ -590,6 +599,10 @@ CosResult ObjectOp::MultiUploadObject(const PutObjectByFileReq& req,
590599
591600 CosResult init_result;
592601 InitMultiUploadResp init_resp;
602+ if (req.IsHttps ()) {
603+ init_req.SetHttps ();
604+ init_req.SetCaLocation (req.GetCaLocation ());
605+ }
593606 init_req.AddHeaders (req.GetHeaders ());
594607 init_req.SetConnTimeoutInms (req.GetConnTimeoutInms ());
595608 init_req.SetRecvTimeoutInms (req.GetRecvTimeoutInms ());
@@ -666,6 +679,10 @@ CosResult ObjectOp::MultiUploadObject(const PutObjectByFileReq& req,
666679 comp_req.SetRecvTimeoutInms (req.GetRecvTimeoutInms () * 2 );
667680 comp_req.SetEtags (etags);
668681 comp_req.SetPartNumbers (part_numbers);
682+ if (req.IsHttps ()) {
683+ comp_req.SetHttps ();
684+ comp_req.SetCaLocation (req.GetCaLocation ());
685+ }
669686
670687 comp_result = CompleteMultiUpload (comp_req, &comp_resp);
671688 // check crc64 if needed
0 commit comments