diff options
author | Ed Tanous <ed@tanous.net> | 2024-04-13 19:11:15 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-18 18:40:17 +0300 |
commit | 8db83747b6ea72de30ac83f19578ecc37489b13d (patch) | |
tree | 86bd287fc7fa1a93df5761af93554ef45f9bdc18 /http/routing | |
parent | 3e7374243ff53125f3a55c2d0b1927e89261b1f9 (diff) | |
download | bmcweb-8db83747b6ea72de30ac83f19578ecc37489b13d.tar.xz |
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 <ed@tanous.net>
Diffstat (limited to 'http/routing')
-rw-r--r-- | http/routing/baserule.hpp | 4 | ||||
-rw-r--r-- | http/routing/sserule.hpp | 3 | ||||
-rw-r--r-- | http/routing/websocketrule.hpp | 4 |
3 files changed, 2 insertions, 9 deletions
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<bmcweb::AsyncResp>&, const std::vector<std::string>&) = 0; -#ifndef BMCWEB_ENABLE_SSL virtual void handleUpgrade(const Request& /*req*/, const std::shared_ptr<bmcweb::AsyncResp>& 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<bmcweb::AsyncResp>& 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<bmcweb::AsyncResp>& /*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<bmcweb::AsyncResp>& /*asyncResp*/, boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&& @@ -55,7 +53,6 @@ class SseSocketRule : public BaseRule std::move(adaptor), openHandler, closeHandler); myConnection->start(); } -#endif template <typename Func> 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<bmcweb::AsyncResp>& /*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<bmcweb::AsyncResp>& /*asyncResp*/, boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&& @@ -56,7 +55,6 @@ class WebSocketRule : public BaseRule messageHandler, messageExHandler, closeHandler, errorHandler); myConnection->start(req); } -#endif template <typename Func> self_t& onopen(Func f) |