From: Abhishek Lekshmanan Date: Mon, 27 Mar 2017 13:09:41 +0000 (+0200) Subject: set_content_length for streamrw requests X-Git-Tag: v13.1.0~270^2~109 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=115dcf6228debbe2896b6c2d0dc0cc112e380979;p=ceph.git set_content_length for streamrw requests Also remove the earlier content length hack Signed-off-by: Abhishek Lekshmanan --- 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;