Revert "Remove AsyncResp from openHandler"
This reverts commit 0f3d3a01aed4040ef73a977a958ecdf4f68111f6.
Seeing bumps fail.
Change-Id: Ida7b1bae48abbed2e00a5259e8f94b64168d4788
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/http/routing.hpp b/http/routing.hpp
index abb1d43..0a0dc74 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -386,7 +386,9 @@
}
protected:
- std::function<void(crow::websocket::Connection&)> openHandler;
+ std::function<void(crow::websocket::Connection&,
+ std::shared_ptr<bmcweb::AsyncResp>)>
+ openHandler;
std::function<void(crow::websocket::Connection&, const std::string&, bool)>
messageHandler;
std::function<void(crow::websocket::Connection&, const std::string&)>
diff --git a/http/websocket.hpp b/http/websocket.hpp
index 06f35d1..324ffd5 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -65,7 +65,8 @@
public:
ConnectionImpl(
const crow::Request& reqIn, Adaptor adaptorIn,
- std::function<void(Connection&)> openHandler,
+ std::function<void(Connection&, std::shared_ptr<bmcweb::AsyncResp>)>
+ openHandler,
std::function<void(Connection&, const std::string&, bool)>
messageHandler,
std::function<void(Connection&, const std::string&)> closeHandler,
@@ -192,11 +193,14 @@
{
BMCWEB_LOG_DEBUG << "Websocket accepted connection";
+ auto asyncResp = std::make_shared<bmcweb::AsyncResp>();
+
+ asyncResp->res.result(boost::beast::http::status::ok);
doRead();
if (openHandler)
{
- openHandler(*this);
+ openHandler(*this, asyncResp);
}
}
@@ -276,7 +280,8 @@
std::vector<std::string> outBuffer;
bool doingWrite = false;
- std::function<void(Connection&)> openHandler;
+ std::function<void(Connection&, std::shared_ptr<bmcweb::AsyncResp>)>
+ openHandler;
std::function<void(Connection&, const std::string&, bool)> messageHandler;
std::function<void(Connection&, const std::string&)> closeHandler;
std::function<void(Connection&)> errorHandler;