From: Casey Bodley Date: Wed, 13 Dec 2023 14:30:35 +0000 (-0500) Subject: rgw/multisite: forwarded requests always pass a bufferlist X-Git-Tag: v19.3.0~359^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b04749215de73b74007e6496f0ca68af78c13b1;p=ceph-ci.git rgw/multisite: forwarded requests always pass a bufferlist 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 --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 750ad7cb773..d4162ec2e3d 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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};