]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/multisite: forwarded requests always pass a bufferlist
authorCasey Bodley <cbodley@redhat.com>
Wed, 13 Dec 2023 14:30:35 +0000 (09:30 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 13 Dec 2023 14:30:37 +0000 (09:30 -0500)
d2dbe7550296da6db885b5344c71f77f9acbfd8f added a rgw_forward_request_to_master()
that took the input bufferlist by pointer instead of reference so it
could be optional; however, RGWRESTSimpleRequest::forward_request()
omits the Content-Length header when the data is nullptr. this was an
unintended change and broke the forwarding of some requests

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.cc

index 750ad7cb7739c7978f5ca8113be89360f561bbe7..d4162ec2e3d3ce87498490cb4a95c3e09d63b9d3 100644 (file)
@@ -132,6 +132,12 @@ int rgw_forward_request_to_master(const DoutPrefixProvider* dpp,
   }
   const RGWAccessKey& creds = site.get_zone_params().system_key;
 
+  bufferlist data;
+  if (indata == nullptr) {
+    // forward() needs an input bufferlist to set the content-length
+    indata = &data;
+  }
+
   // use the master zone's endpoints
   auto conn = RGWRESTConn{dpp->get_cct(), z->second.id, z->second.endpoints,
                           creds, zg->second.id, zg->second.api_name};