Skip to content

Commit 4470fd3

Browse files
chen-hongganggavinhgchen
andauthored
etag不匹配时增加body长度信息与requestid (#121)
Co-authored-by: gavinhgchen <[email protected]>
1 parent d3555e6 commit 4470fd3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/op/base_op.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ CosResult BaseOp::DownloadAction(const std::string& host,
188188
&xml_err_str, os, &err_msg, &real_byte, req.CheckMD5(), req.GetCaLocation());
189189
if (http_code == -1) {
190190
result.SetErrorMsg(err_msg);
191+
resp->ParseFromHeaders(resp_headers);
192+
result.SetXCosRequestId(resp->GetXCosRequestId());
191193
return result;
192194
}
193195

src/util/http_sender.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ int HttpSender::SendRequest(
452452
*err_msg =
453453
"Md5 of response body is not equal to the etag in the header."
454454
" Body Md5= " +
455-
md5_str + ", etag=" + etag;
455+
md5_str + ", etag=" + etag +
456+
", recv-len=" + StringUtil::Uint64ToString(*real_byte) +
457+
", content-length=" + content_length_header;
456458
SDK_LOG_ERR("Check Md5 fail, %s", err_msg->c_str());
457459
ret = -1;
458460
}

0 commit comments

Comments
 (0)