Skip to content

Commit

Permalink
etag不匹配时增加body长度信息与requestid (#121)
Browse files Browse the repository at this point in the history
Co-authored-by: gavinhgchen <[email protected]>
  • Loading branch information
chen-honggang and gavinhgchen authored Nov 23, 2022
1 parent d3555e6 commit 4470fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/op/base_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ CosResult BaseOp::DownloadAction(const std::string& host,
&xml_err_str, os, &err_msg, &real_byte, req.CheckMD5(), req.GetCaLocation());
if (http_code == -1) {
result.SetErrorMsg(err_msg);
resp->ParseFromHeaders(resp_headers);
result.SetXCosRequestId(resp->GetXCosRequestId());
return result;
}

Expand Down
4 changes: 3 additions & 1 deletion src/util/http_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ int HttpSender::SendRequest(
*err_msg =
"Md5 of response body is not equal to the etag in the header."
" Body Md5= " +
md5_str + ", etag=" + etag;
md5_str + ", etag=" + etag +
", recv-len=" + StringUtil::Uint64ToString(*real_byte) +
", content-length=" + content_length_header;
SDK_LOG_ERR("Check Md5 fail, %s", err_msg->c_str());
ret = -1;
}
Expand Down

0 comments on commit 4470fd3

Please sign in to comment.