bmcweb: Fix header includes to be more specific
In a lot of cases, the header include patterns were really bad. For
example, pulling in all of boost asio via boost/asio.hpp, rather than
pulling in the lesser equivalents. This should reduce the build times,
although I have no data on that at the moment.
Tested By:
Code still compiles
Change-Id: I0f4656d35cf6d7722d1b515baaccbfc27cf98961
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/crow/include/crow/http_connection.h b/crow/include/crow/http_connection.h
index 1a2627a..2b84b8d 100644
--- a/crow/include/crow/http_connection.h
+++ b/crow/include/crow/http_connection.h
@@ -1,12 +1,12 @@
#pragma once
#include "http_utility.hpp"
-#include <array>
#include <atomic>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
-#include <boost/asio.hpp>
-#include <boost/beast/core.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/websocket.hpp>
#include <chrono>
@@ -20,7 +20,7 @@
#include "crow/utility.h"
#ifdef BMCWEB_ENABLE_SSL
-#include <boost/asio/ssl.hpp>
+#include <boost/asio/ssl/stream.hpp>
#endif
namespace crow
@@ -596,7 +596,7 @@
boost::beast::http::request_parser<boost::beast::http::string_body>>
parser;
- boost::beast::flat_buffer buffer{8192};
+ boost::beast::flat_static_buffer<8192> buffer;
boost::optional<boost::beast::http::response_serializer<
boost::beast::http::string_body>>
@@ -620,5 +620,5 @@
std::function<std::string()>& getCachedDateStr;
detail::TimerQueue& timerQueue;
-}; // namespace crow
+};
} // namespace crow
diff --git a/crow/include/crow/http_request.h b/crow/include/crow/http_request.h
index 0e6dd12..e66ad4b 100644
--- a/crow/include/crow/http_request.h
+++ b/crow/include/crow/http_request.h
@@ -1,6 +1,6 @@
#pragma once
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/websocket.hpp>
diff --git a/crow/include/crow/http_server.h b/crow/include/crow/http_server.h
index 173d0d1..d8fedf3 100644
--- a/crow/include/crow/http_server.h
+++ b/crow/include/crow/http_server.h
@@ -1,7 +1,9 @@
#pragma once
#include <atomic>
-#include <boost/asio.hpp>
+#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/signal_set.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <chrono>
#include <cstdint>
@@ -14,7 +16,7 @@
#include "crow/logging.h"
#include "crow/timer_queue.h"
#ifdef BMCWEB_ENABLE_SSL
-#include <boost/asio/ssl.hpp>
+#include <boost/asio/ssl/context.hpp>
#endif
namespace crow
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index 47893bf..32d7a73 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -11,7 +11,7 @@
#include <openssl/rsa.h>
#include <openssl/ssl.h>
-#include <boost/asio.hpp>
+#include <boost/asio/ssl/context.hpp>
#include <random>
namespace ensuressl
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index fc2638a..b4d36ef 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -1,7 +1,7 @@
#include <crow/app.h>
#include <systemd/sd-daemon.h>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include <dbus_monitor.hpp>
#include <dbus_singleton.hpp>
#include <image_upload.hpp>