From 8db83747b6ea72de30ac83f19578ecc37489b13d Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Sat, 13 Apr 2024 09:11:15 -0700 Subject: Clean up BMCWEB_ENABLE_SSL This macro came originally from CROW_ENABLE_SSL, and was used as a macro to optionally compile without openssl being required. OpenSSL has been pulled into many other dependencies, and has been functionally required to be included for a long time, so there's no reason to hold onto this macro. Remove most uses of the macro, and for the couple functional places the macro is used, transition to a constexpr if to enable the TLS paths. This allows a large simplification of code in some places. Tested: Redfish service validator passes. Change-Id: Iebd46a68e5e417b6031479e24be3c21bef782f4c Signed-off-by: Ed Tanous --- http/routing/baserule.hpp | 4 +--- http/routing/sserule.hpp | 3 --- http/routing/websocketrule.hpp | 4 +--- 3 files changed, 2 insertions(+), 9 deletions(-) (limited to 'http/routing') diff --git a/http/routing/baserule.hpp b/http/routing/baserule.hpp index 0913020935..f99e16ecf3 100644 --- a/http/routing/baserule.hpp +++ b/http/routing/baserule.hpp @@ -37,7 +37,6 @@ class BaseRule virtual void handle(const Request& /*req*/, const std::shared_ptr&, const std::vector&) = 0; -#ifndef BMCWEB_ENABLE_SSL virtual void handleUpgrade(const Request& /*req*/, const std::shared_ptr& asyncResp, @@ -45,7 +44,7 @@ class BaseRule { asyncResp->res.result(boost::beast::http::status::not_found); } -#else + virtual void handleUpgrade( const Request& /*req*/, const std::shared_ptr& asyncResp, @@ -53,7 +52,6 @@ class BaseRule { asyncResp->res.result(boost::beast::http::status::not_found); } -#endif size_t getMethods() const { diff --git a/http/routing/sserule.hpp b/http/routing/sserule.hpp index c0a4e504b3..ad05bafbe2 100644 --- a/http/routing/sserule.hpp +++ b/http/routing/sserule.hpp @@ -30,7 +30,6 @@ class SseSocketRule : public BaseRule asyncResp->res.result(boost::beast::http::status::not_found); } -#ifndef BMCWEB_ENABLE_SSL void handleUpgrade(const Request& /*req*/, const std::shared_ptr& /*asyncResp*/, boost::asio::ip::tcp::socket&& adaptor) override @@ -42,7 +41,6 @@ class SseSocketRule : public BaseRule std::move(adaptor), openHandler, closeHandler); myConnection->start(); } -#else void handleUpgrade(const Request& /*req*/, const std::shared_ptr& /*asyncResp*/, boost::beast::ssl_stream&& @@ -55,7 +53,6 @@ class SseSocketRule : public BaseRule std::move(adaptor), openHandler, closeHandler); myConnection->start(); } -#endif template self_t& onopen(Func f) diff --git a/http/routing/websocketrule.hpp b/http/routing/websocketrule.hpp index bf6daad6d0..b52d9ec9a7 100644 --- a/http/routing/websocketrule.hpp +++ b/http/routing/websocketrule.hpp @@ -27,7 +27,6 @@ class WebSocketRule : public BaseRule asyncResp->res.result(boost::beast::http::status::not_found); } -#ifndef BMCWEB_ENABLE_SSL void handleUpgrade(const Request& req, const std::shared_ptr& /*asyncResp*/, boost::asio::ip::tcp::socket&& adaptor) override @@ -41,7 +40,7 @@ class WebSocketRule : public BaseRule messageHandler, messageExHandler, closeHandler, errorHandler); myConnection->start(req); } -#else + void handleUpgrade(const Request& req, const std::shared_ptr& /*asyncResp*/, boost::beast::ssl_stream&& @@ -56,7 +55,6 @@ class WebSocketRule : public BaseRule messageHandler, messageExHandler, closeHandler, errorHandler); myConnection->start(req); } -#endif template self_t& onopen(Func f) -- cgit v1.2.3