]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
set_content_length for streamrw requests
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 27 Mar 2017 13:09:41 +0000 (15:09 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:03:10 +0000 (08:03 -0700)
Also remove the earlier content length hack
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_cr_rest.h
src/rgw/rgw_rest_client.cc

index 812e3f084515d030e20ae5d26125a54c77b04f79..ddeb00af24500276dde59ebf587694c02701bbad 100644 (file)
@@ -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<RGWRESTSendResource>(
-        new RGWRESTSendResource(conn, method, path, params, &p, http_manager));
+        new RGWRESTSendResource(conn, method, path, params, nullptr, http_manager));
 
     op->set_user_info((void *)stack);
 
index 079a305c2fc6b71ce6a613bcabca61ee1e400534..a129ee53d31c4c2a616f82ab9427a2d032c8530b 100644 (file)
@@ -685,6 +685,13 @@ int RGWRESTStreamRWRequest::send_request(RGWAccessKey *key, map<string, string>&
     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;