Fix using namespace
We inherited a "using namespace" crow. Lets fix it.
Tested:
Code compiles. No functional changes.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Id47446150dfb312c5cd84a4b4284fb824eba8021
diff --git a/http/app.h b/http/app.h
index 2eca4d2..ff8642d 100644
--- a/http/app.h
+++ b/http/app.h
@@ -211,7 +211,7 @@
#endif
private:
- std::shared_ptr<asio::io_context> io;
+ std::shared_ptr<boost::asio::io_context> io;
#ifdef BMCWEB_ENABLE_SSL
uint16_t portUint = 443;
#else
diff --git a/http/http_connection.h b/http/http_connection.h
index 7781ca6..7e23de4 100644
--- a/http/http_connection.h
+++ b/http/http_connection.h
@@ -58,9 +58,6 @@
res.addHeader("Content-Type", "text/html;charset=UTF-8");
}
-using namespace boost;
-using tcp = asio::ip::tcp;
-
#ifdef BMCWEB_ENABLE_DEBUG
static std::atomic<int> connectionCount;
#endif
diff --git a/http/http_server.h b/http/http_server.h
index 422b3a7..92971fb 100644
--- a/http/http_server.h
+++ b/http/http_server.h
@@ -24,14 +24,13 @@
namespace crow
{
-using namespace boost;
-using tcp = asio::ip::tcp;
template <typename Handler, typename Adaptor = boost::asio::ip::tcp::socket>
class Server
{
public:
- Server(Handler* handlerIn, std::unique_ptr<tcp::acceptor>&& acceptorIn,
+ Server(Handler* handlerIn,
+ std::unique_ptr<boost::asio::ip::tcp::acceptor>&& acceptorIn,
std::shared_ptr<boost::asio::ssl::context> adaptor_ctx,
std::shared_ptr<boost::asio::io_context> io =
std::make_shared<boost::asio::io_context>()) :
@@ -46,9 +45,9 @@
std::shared_ptr<boost::asio::io_context> io =
std::make_shared<boost::asio::io_context>()) :
Server(handlerIn,
- std::make_unique<tcp::acceptor>(
- *io, tcp::endpoint(boost::asio::ip::make_address(bindaddr),
- port)),
+ std::make_unique<boost::asio::ip::tcp::acceptor>(
+ *io, boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::make_address(bindaddr), port)),
adaptor_ctx, io)
{}
@@ -57,8 +56,8 @@
std::shared_ptr<boost::asio::io_context> io =
std::make_shared<boost::asio::io_context>()) :
Server(handlerIn,
- std::make_unique<tcp::acceptor>(*io, boost::asio::ip::tcp::v6(),
- existing_socket),
+ std::make_unique<boost::asio::ip::tcp::acceptor>(
+ *io, boost::asio::ip::tcp::v6(), existing_socket),
adaptor_ctx, io)
{}
@@ -220,10 +219,10 @@
}
private:
- std::shared_ptr<asio::io_context> ioService;
+ std::shared_ptr<boost::asio::io_context> ioService;
detail::TimerQueue timerQueue;
std::function<std::string()> getCachedDateStr;
- std::unique_ptr<tcp::acceptor> acceptor;
+ std::unique_ptr<boost::asio::ip::tcp::acceptor> acceptor;
boost::asio::signal_set signals;
boost::asio::steady_timer timer;
diff --git a/include/image_upload.hpp b/include/image_upload.hpp
index 9d0a0ca..25b4f2a 100644
--- a/include/image_upload.hpp
+++ b/include/image_upload.hpp
@@ -36,7 +36,7 @@
auto timeoutHandler = [&res](const boost::system::error_code& ec) {
fwUpdateMatcher = nullptr;
- if (ec == asio::error::operation_aborted)
+ if (ec == boost::asio::error::operation_aborted)
{
// expected, we were canceled before the timer completed.
return;
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index eeff817..c909a90 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -389,7 +389,7 @@
path);
}
- Subscription(const std::shared_ptr<crow::Request::Adaptor>& adaptor) :
+ Subscription(const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
eventSeqNum(1)
{
sseConn = std::make_shared<crow::ServerSentEvents>(adaptor);
diff --git a/redfish-core/include/server_sent_events.hpp b/redfish-core/include/server_sent_events.hpp
index ada5da7..26fc675 100644
--- a/redfish-core/include/server_sent_events.hpp
+++ b/redfish-core/include/server_sent_events.hpp
@@ -50,7 +50,7 @@
class ServerSentEvents : public std::enable_shared_from_this<ServerSentEvents>
{
private:
- std::shared_ptr<crow::Request::Adaptor> sseConn;
+ std::shared_ptr<boost::beast::tcp_stream> sseConn;
std::queue<std::pair<uint64_t, std::string>> requestDataQueue;
std::string outBuffer;
SseConnState state;
@@ -259,7 +259,7 @@
ServerSentEvents(ServerSentEvents&&) = delete;
ServerSentEvents& operator=(ServerSentEvents&&) = delete;
- ServerSentEvents(const std::shared_ptr<crow::Request::Adaptor>& adaptor) :
+ ServerSentEvents(const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
sseConn(std::move(adaptor)), state(SseConnState::startInit),
retryCount(0), maxRetryAttempts(5)
{