diff options
author | zhanghch05 <zhanghch05@inspur.com> | 2021-10-21 09:07:57 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-03-29 04:56:16 +0300 |
commit | 7772638ea777820234e6004ee63dc558e629e35e (patch) | |
tree | 7c3c82565e74370751efd0308199ee4039add782 /http/websocket.hpp | |
parent | 1c8252799b1c97fad5b05c5746ec512292a1f66c (diff) | |
download | bmcweb-7772638ea777820234e6004ee63dc558e629e35e.tar.xz |
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
Diffstat (limited to 'http/websocket.hpp')
-rw-r--r-- | http/websocket.hpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/http/websocket.hpp b/http/websocket.hpp index bd7b8416ae..b2c24c403a 100644 --- a/http/websocket.hpp +++ b/http/websocket.hpp @@ -70,8 +70,7 @@ class ConnectionImpl : public Connection 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 @@ class ConnectionImpl : public Connection { 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 @@ class ConnectionImpl : public Connection 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; |