From 6b04749215de73b74007e6496f0ca68af78c13b1 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 13 Dec 2023 09:30:35 -0500 Subject: [PATCH] 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 --- src/rgw/rgw_op.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 750ad7cb7739c..d4162ec2e3d3c 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}; -- 2.39.5