From 115dcf6228debbe2896b6c2d0dc0cc112e380979 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 27 Mar 2017 15:09:41 +0200 Subject: [PATCH] set_content_length for streamrw requests Also remove the earlier content length hack Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_cr_rest.h | 9 +-------- src/rgw/rgw_rest_client.cc | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rgw/rgw_cr_rest.h b/src/rgw/rgw_cr_rest.h index 812e3f08451..ddeb00af245 100644 --- a/src/rgw/rgw_cr_rest.h +++ b/src/rgw/rgw_cr_rest.h @@ -126,15 +126,8 @@ class RGWSendRawRESTResourceCR: public RGWSimpleCoroutine { } int send_request() override { - param_vec_t p; - if (send_content_length){ - lsubdout(cct, rgw, 0) << "abhi: sending content length of " << input_bl.length() << dendl; - string content_length = to_string(input_bl.length()); - p.push_back(param_pair_t("CONTENT_LENGTH",content_length)); - } - auto op = boost::intrusive_ptr( - new RGWRESTSendResource(conn, method, path, params, &p, http_manager)); + new RGWRESTSendResource(conn, method, path, params, nullptr, http_manager)); op->set_user_info((void *)stack); diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index 079a305c2fc..a129ee53d31 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -685,6 +685,13 @@ int RGWRESTStreamRWRequest::send_request(RGWAccessKey *key, map& pmanager = mgr; } + uint64_t send_size = (size_t)(outbl.length() - write_ofs); + + if (send_size > 0){ + ldout(cct, 0) << "ABHI!!! set send len to " << send_size << dendl; + set_send_length(send_size); + } + int r = pmanager->add_request(this, new_info.method, new_url.c_str(), send_data_hint); if (r < 0) return r; -- 2.39.5