summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
Diffstat (limited to 'http')
-rw-r--r--http/app.hpp4
-rw-r--r--http/http_client.hpp8
-rw-r--r--http/http_connection.hpp14
-rw-r--r--http/http_server.hpp2
-rw-r--r--http/logging.hpp2
-rw-r--r--http/mutual_tls.hpp2
-rw-r--r--http/utility.hpp2
7 files changed, 16 insertions, 18 deletions
diff --git a/http/app.hpp b/http/app.hpp
index 01ad7558ad..eea13058e1 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -35,8 +35,8 @@ class App
using ssl_socket_t = boost::asio::ssl::stream<boost::asio::ip::tcp::socket>;
using raw_socket_t = boost::asio::ip::tcp::socket;
- using socket_type =
- std::conditional_t<bmcwebEnableTLS, ssl_socket_t, raw_socket_t>;
+ using socket_type = std::conditional_t<BMCWEB_INSECURE_DISABLE_SSL,
+ raw_socket_t, ssl_socket_t>;
using server_type = Server<App, socket_type>;
explicit App(std::shared_ptr<boost::asio::io_context> ioIn =
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 860a7d45a8..ac231b42e7 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -149,11 +149,9 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo>
boost::asio::io_context& ioc;
-#ifdef BMCWEB_DBUS_DNS_RESOLVER
- using Resolver = async_resolve::Resolver;
-#else
- using Resolver = boost::asio::ip::tcp::resolver;
-#endif
+ using Resolver = std::conditional_t<BMCWEB_DNS_RESOLVER == "systemd-dbus",
+ async_resolve::Resolver,
+ boost::asio::ip::tcp::resolver>;
Resolver resolver;
boost::asio::ip::tcp::socket conn;
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index d0aa5d5be4..e02c518ebb 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -38,9 +38,8 @@ namespace crow
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static int connectionCount = 0;
-// request body limit size set by the bmcwebHttpReqBodyLimitMb option
-constexpr uint64_t httpReqBodyLimit = 1024UL * 1024UL *
- bmcwebHttpReqBodyLimitMb;
+// request body limit size set by the BMCWEB_HTTP_BODY_LIMIT option
+constexpr uint64_t httpReqBodyLimit = 1024UL * 1024UL * BMCWEB_HTTP_BODY_LIMIT;
constexpr uint64_t loggedOutPostBodyLimit = 4096U;
@@ -70,9 +69,10 @@ class Connection :
{
initParser();
-#ifdef BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION
- prepareMutualTls();
-#endif // BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION
+ if constexpr (BMCWEB_MUTUAL_TLS_AUTH)
+ {
+ prepareMutualTls();
+ }
connectionCount++;
@@ -187,7 +187,7 @@ class Connection :
void afterSslHandshake()
{
// If http2 is enabled, negotiate the protocol
- if constexpr (bmcwebEnableHTTP2)
+ if constexpr (BMCWEB_EXPERIMENTAL_HTTP2)
{
const unsigned char* alpn = nullptr;
unsigned int alpnlen = 0;
diff --git a/http/http_server.hpp b/http/http_server.hpp
index a3708944b7..206a0d175e 100644
--- a/http/http_server.hpp
+++ b/http/http_server.hpp
@@ -74,7 +74,7 @@ class Server
void loadCertificate()
{
- if constexpr (!bmcwebEnableTLS)
+ if constexpr (BMCWEB_INSECURE_DISABLE_SSL)
{
return;
}
diff --git a/http/logging.hpp b/http/logging.hpp
index 9b1a36b143..cf908771bb 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -54,7 +54,7 @@ constexpr crow::LogLevel getLogLevelFromName(std::string_view name)
// configured bmcweb LogLevel
constexpr crow::LogLevel bmcwebCurrentLoggingLevel =
- getLogLevelFromName(bmcwebLoggingLevel);
+ getLogLevelFromName(BMCWEB_LOGGING_LEVEL);
template <typename T>
const void* logPtr(T p)
diff --git a/http/mutual_tls.hpp b/http/mutual_tls.hpp
index 9f9f82b297..5392549b16 100644
--- a/http/mutual_tls.hpp
+++ b/http/mutual_tls.hpp
@@ -94,7 +94,7 @@ inline std::shared_ptr<persistent_data::UserSession>
sslUser.resize(lastChar);
// Meta Inc. CommonName parsing
- if (bmcwebMTLSCommonNameParsingMeta)
+ if constexpr (BMCWEB_MUTUAL_TLS_COMMON_NAME_PARSING == "meta")
{
std::optional<std::string_view> sslUserMeta =
mtlsMetaParseSslUser(sslUser);
diff --git a/http/utility.hpp b/http/utility.hpp
index 1d6750098f..da174e538f 100644
--- a/http/utility.hpp
+++ b/http/utility.hpp
@@ -497,7 +497,7 @@ inline void setProtocolDefaults(boost::urls::url& url,
}
if (url.port_number() == 80)
{
- if (bmcwebInsecureEnableHttpPushStyleEventing)
+ if constexpr (BMCWEB_INSECURE_PUSH_STYLE_NOTIFICATION)
{
url.set_scheme("http");
}