Remove AsyncResp from openHandler
This change, moving the openHandler back to only supporting websocket
disconnects and not 404s.Because AsyncResp is removed from openHandler.
Tested:
(from previous commit) Opened KVM in webui-vue and it works.
Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I793f05836aeccdc275b7aaaeede41b3a2c276595
diff --git a/http/websocket.hpp b/http/websocket.hpp
index bd7b841..b2c24c4 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -70,8 +70,7 @@
public:
ConnectionImpl(
const crow::Request& reqIn, Adaptor adaptorIn,
- std::function<void(Connection&, std::shared_ptr<bmcweb::AsyncResp>)>
- openHandler,
+ std::function<void(Connection&)> openHandler,
std::function<void(Connection&, const std::string&, bool)>
messageHandler,
std::function<void(Connection&, const std::string&)> closeHandler,
@@ -199,14 +198,11 @@
{
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, asyncResp);
+ openHandler(*this);
}
}
@@ -286,8 +282,7 @@
std::vector<std::string> outBuffer;
bool doingWrite = false;
- std::function<void(Connection&, std::shared_ptr<bmcweb::AsyncResp>)>
- openHandler;
+ std::function<void(Connection&)> openHandler;
std::function<void(Connection&, const std::string&, bool)> messageHandler;
std::function<void(Connection&, const std::string&)> closeHandler;
std::function<void(Connection&)> errorHandler;