Revert "treewide: seastar module update and fix broken rest client"

This reverts commit 44d34663bc of PR
https://github.com/scylladb/scylladb/pull/25915.

Breaks articact tests on ARM, blocking us from building new images from
master.
This commit is contained in:
Botond Dénes
2025-09-16 08:31:08 +03:00
parent 18cb748268
commit ee7c85919e
7 changed files with 22 additions and 13 deletions

View File

@@ -399,7 +399,8 @@ future<rjson::value> azure_host::impl::send_request(const sstring& host, unsigne
client.target(path); client.target(path);
client.method(httpd::operation_type::POST); client.method(httpd::operation_type::POST);
client.add_header("Authorization", fmt::format("Bearer {}", token.token)); client.add_header("Authorization", fmt::format("Bearer {}", token.token));
client.content("application/json", std::move(rjson::print(body))); client.add_header("Content-Type", "application/json");
client.content(std::move(rjson::print(body)));
azlog.trace("Sending request: {}", rest::redacted_request_type{ client.request(), filter }); azlog.trace("Sending request: {}", rest::redacted_request_type{ client.request(), filter });

View File

@@ -808,7 +808,7 @@ future<encryption::kms_host::impl::result_type> encryption::kms_host::impl::post
client.add_header(AWS_AUTHORIZATION_HEADER, awsAuthString); client.add_header(AWS_AUTHORIZATION_HEADER, awsAuthString);
client.target("/"); client.target("/");
client.content(query.content_type, query.content); client.content(query.content);
client.method(httpclient::method_type::POST); client.method(httpclient::method_type::POST);
kms_log.trace("Request: {}", client.request()); kms_log.trace("Request: {}", client.request());

Submodule seastar updated: b6be384e5d...c2d9893334

View File

@@ -170,7 +170,8 @@ future<sstring> service_principal_credentials::post(const sstring& body) {
rest::httpclient client{_host, _port, std::move(creds), options}; rest::httpclient client{_host, _port, std::move(creds), options};
client.target(path); client.target(path);
client.method(op); client.method(op);
client.content(mime_type, std::move(body)); client.add_header("Content-Type", mime_type);
client.content(std::move(body));
if (az_creds_logger.is_enabled(log_level::trace)) { if (az_creds_logger.is_enabled(log_level::trace)) {
az_creds_logger.trace("[{}] Sending request: {}", *this, rest::redacted_request_type{ client.request(), filter }); az_creds_logger.trace("[{}] Sending request: {}", *this, rest::redacted_request_type{ client.request(), filter });

View File

@@ -294,9 +294,13 @@ utils::gcp::storage::client::impl::send_with_retry(const std::string& path, cons
req.add_header(k, v); req.add_header(k, v);
} }
if (!content_type.empty()) {
req.add_header(httpclient::CONTENT_TYPE_HEADER, content_type);
}
std::visit(overloaded_functor { std::visit(overloaded_functor {
[&](const std::string& s) { req.content(content_type, s); }, [&](const std::string& s) { req.content(s); },
[&](const writer_and_size& ws) { req.content(content_type, ws.first, ws.second); } [&](const writer_and_size& ws) { req.content(ws.first, ws.second); }
}, body); }, body);
// GCP storage requires this even if content is empty // GCP storage requires this even if content is empty

View File

@@ -39,12 +39,14 @@ void rest::request_wrapper::method(method_type type) {
_req._method = httpd::type2str(type); _req._method = httpd::type2str(type);
} }
void rest::request_wrapper::content(std::string_view content_type, std::string_view content) { void rest::request_wrapper::content(std::string_view content) {
_req.write_body(sstring(content_type), sstring(content)); _req.content_length = content.size();
_req.content = sstring(content);
} }
void rest::request_wrapper::content(std::string_view content_type, body_writer w, size_t len) { void rest::request_wrapper::content(body_writer w, size_t len) {
_req.write_body(sstring(content_type), len, std::move(w)); _req.content_length = len;
_req.body_writer = std::move(w);
} }
void rest::request_wrapper::target(std::string_view s) { void rest::request_wrapper::target(std::string_view s) {
@@ -217,7 +219,8 @@ future<> rest::send_request(std::string_view uri
if (content_type.empty()) { if (content_type.empty()) {
content_type = "application/x-www-form-urlencoded"; content_type = "application/x-www-form-urlencoded";
} }
client.content(content_type, std::move(body)); client.content(std::move(body));
client.add_header(httpclient::CONTENT_TYPE_HEADER, content_type);
} }
co_await client.send([&] (const http::reply& rep, std::string_view result) { co_await client.send([&] (const http::reply& rep, std::string_view result) {

View File

@@ -41,8 +41,8 @@ public:
using body_writer = decltype(std::declval<seastar::http::request>().body_writer); using body_writer = decltype(std::declval<seastar::http::request>().body_writer);
void method(method_type); void method(method_type);
void content(std::string_view content_type, std::string_view); void content(std::string_view);
void content(std::string_view content_type, body_writer, size_t); void content(body_writer, size_t);
void target(std::string_view); void target(std::string_view);