From 8c7ff91faac45775792b4c81a51e5cf81d0e5e67 Mon Sep 17 00:00:00 2001 From: gavinhgchen Date: Wed, 23 Nov 2022 17:50:41 +0800 Subject: [PATCH] =?UTF-8?q?etag=E4=B8=8D=E5=8C=B9=E9=85=8D=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0body=E9=95=BF=E5=BA=A6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8Erequestid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/op/base_op.cpp | 2 ++ src/util/http_sender.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/op/base_op.cpp b/src/op/base_op.cpp index aba1837..96e1576 100644 --- a/src/op/base_op.cpp +++ b/src/op/base_op.cpp @@ -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; } diff --git a/src/util/http_sender.cpp b/src/util/http_sender.cpp index 7631513..9f3b560 100644 --- a/src/util/http_sender.cpp +++ b/src/util/http_sender.cpp @@ -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; }