From f46ff8fcd90913bf62de612addcac0775bafee6a Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 13 Mar 2023 17:18:39 -0400 Subject: [PATCH] Revert "rgw/beast: add extra_response_headers for Server name" This reverts commit ffeacc095963436588da749f34c5890ca8c74aa4. Signed-off-by: Casey Bodley --- src/rgw/rgw_asio_client.cc | 9 +-------- src/rgw/rgw_asio_client.h | 4 +--- src/rgw/rgw_asio_frontend.cc | 20 +++++--------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/rgw/rgw_asio_client.cc b/src/rgw/rgw_asio_client.cc index cee16d06a44a8..a0ec0bf5c0683 100644 --- a/src/rgw/rgw_asio_client.cc +++ b/src/rgw/rgw_asio_client.cc @@ -14,12 +14,10 @@ using namespace rgw::asio; ClientIO::ClientIO(parser_type& parser, bool is_ssl, const endpoint_type& local_endpoint, - const endpoint_type& remote_endpoint, - std::string_view extra_response_headers) + const endpoint_type& remote_endpoint) : parser(parser), is_ssl(is_ssl), local_endpoint(local_endpoint), remote_endpoint(remote_endpoint), - extra_response_headers(extra_response_headers), txbuf(*this) { } @@ -151,11 +149,6 @@ size_t ClientIO::complete_header() sent += txbuf.sputn(timestr, strlen(timestr)); } - if (extra_response_headers.size()) { - sent += txbuf.sputn(extra_response_headers.data(), - extra_response_headers.size()); - } - if (parser.keep_alive()) { constexpr char CONN_KEEP_ALIVE[] = "Connection: Keep-Alive\r\n"; sent += txbuf.sputn(CONN_KEEP_ALIVE, sizeof(CONN_KEEP_ALIVE) - 1); diff --git a/src/rgw/rgw_asio_client.h b/src/rgw/rgw_asio_client.h index b7f0e003a2e1e..e2ab943dd57f7 100644 --- a/src/rgw/rgw_asio_client.h +++ b/src/rgw/rgw_asio_client.h @@ -25,7 +25,6 @@ class ClientIO : public io::RestfulClient, using endpoint_type = boost::asio::ip::tcp::endpoint; endpoint_type local_endpoint; endpoint_type remote_endpoint; - std::string_view extra_response_headers; RGWEnv env; @@ -35,8 +34,7 @@ class ClientIO : public io::RestfulClient, public: ClientIO(parser_type& parser, bool is_ssl, const endpoint_type& local_endpoint, - const endpoint_type& remote_endpoint, - std::string_view extra_response_headers); + const endpoint_type& remote_endpoint); ~ClientIO() override; int init_env(CephContext *cct) override; diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index fa05102882f3d..633a2963300f6 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -16,7 +16,6 @@ #include "common/async/shared_mutex.h" #include "common/errno.h" #include "common/strtol.h" -#include "ceph_ver.h" #include "rgw_asio_client.h" #include "rgw_asio_frontend.h" @@ -79,10 +78,8 @@ class StreamIO : public rgw::asio::ClientIO { rgw::asio::parser_type& parser, yield_context yield, parse_buffer& buffer, bool is_ssl, const tcp::endpoint& local_endpoint, - const tcp::endpoint& remote_endpoint, - std::string_view extra_response_headers) - : ClientIO(parser, is_ssl, local_endpoint, remote_endpoint, - extra_response_headers), + const tcp::endpoint& remote_endpoint) + : ClientIO(parser, is_ssl, local_endpoint, remote_endpoint), cct(cct), stream(stream), timeout(timeout), yield(yield), buffer(buffer) {} @@ -196,7 +193,6 @@ void handle_connection(boost::asio::io_context& context, SharedMutex& pause_mutex, rgw::dmclock::Scheduler *scheduler, const std::string& uri_prefix, - std::string_view extra_response_headers, boost::system::error_code& ec, yield_context yield) { @@ -269,8 +265,7 @@ void handle_connection(boost::asio::io_context& context, } StreamIO real_client{cct, stream, timeout, parser, yield, buffer, - is_ssl, local_endpoint, remote_endpoint, - extra_response_headers}; + is_ssl, local_endpoint, remote_endpoint}; auto real_client_io = rgw::io::add_reordering( rgw::io::add_buffering(cct, @@ -442,8 +437,6 @@ class AsioFrontend { std::unique_ptr client_config; void accept(Listener& listener, boost::system::error_code ec); - std::string extra_response_headers; - public: AsioFrontend(RGWProcessEnv& env, RGWFrontendConfig* conf, dmc::SchedulerCtx& sched_ctx) @@ -565,9 +558,6 @@ int AsioFrontend::init() boost::system::error_code ec; auto& config = conf->get_config_map(); - // format the Server response header - extra_response_headers = "Server: Ceph Object Gateway (" CEPH_RELEASE_NAME ")\r\n"; - if (auto i = config.find("prefix"); i != config.end()) { uri_prefix = i->second; } @@ -1045,7 +1035,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec) conn->buffer.consume(bytes); handle_connection(context, env, stream, timeout, header_limit, conn->buffer, true, pause_mutex, scheduler.get(), - uri_prefix, extra_response_headers, ec, yield); + uri_prefix, ec, yield); if (!ec) { // ssl shutdown (ignoring errors) stream.async_shutdown(yield[ec]); @@ -1064,7 +1054,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec) boost::system::error_code ec; handle_connection(context, env, conn->socket, timeout, header_limit, conn->buffer, false, pause_mutex, scheduler.get(), - uri_prefix, extra_response_headers, ec, yield); + uri_prefix, ec, yield); conn->socket.shutdown(tcp_socket::shutdown_both, ec); }, make_stack_allocator()); } -- 2.39.5