summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-11-30 02:45:10 +0300
committerEd Tanous <ed.tanous@intel.com>2018-12-04 21:29:23 +0300
commit3112a144b3d47b8927ef1ad0eaa2094c7fbb96fe (patch)
tree5657e2d795e5ead3f59f1578fdf35597b4c367b2
parent99ad5995089bace233dac20de28ef021591d89c1 (diff)
downloadbmcweb-3112a144b3d47b8927ef1ad0eaa2094c7fbb96fe.tar.xz
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>
-rw-r--r--crow/include/crow/http_connection.h12
-rw-r--r--crow/include/crow/http_request.h2
-rw-r--r--crow/include/crow/http_server.h6
-rw-r--r--include/ssl_key_handler.hpp2
-rw-r--r--src/webserver_main.cpp2
5 files changed, 13 insertions, 11 deletions
diff --git a/crow/include/crow/http_connection.h b/crow/include/crow/http_connection.h
index 1a2627ad85..2b84b8dcea 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 @@ class Connection
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 @@ class Connection
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 0e6dd12932..e66ad4be27 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 173d0d1ffb..d8fedf3bcd 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 47893bfb5e..32d7a7368b 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 fc2638a36e..b4d36efb4e 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>