summaryrefslogtreecommitdiff
path: root/http/app.hpp
diff options
context:
space:
mode:
authorP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2021-10-18 20:15:37 +0300
committerEd Tanous <ed@tanous.net>2023-03-15 00:23:02 +0300
commita9f076e521433190bc526fa3eb4587090f48b909 (patch)
tree5b49b173502a85d1a7bd504a95a6f114b8b5230a /http/app.hpp
parentad595fa64f619124eadcdfc2af259a1975136399 (diff)
downloadbmcweb-a9f076e521433190bc526fa3eb4587090f48b909.tar.xz
Add asyncResp support to handleUpgrade
This commit enables passing down the asyncResp (of the connection) to the handler of upgraded connections. This is already in place for normal requests (i.e. Class Router -> handle()) This change would enable any async calls that would be required before upgrade of the connection. For example, as on today, we have only Authentication of user in place for upgraded connection, but not Authorization. So, this asyncResp could further be used for such dbus calls to return informative response. This commit updates the signature of all the handleUpgrade() functions present in router.hpp to take in asyncResp object instead of normal response. Tested : - websocket_test.py Passed - KVM was functional in WebUI. Change-Id: I1c6c91f126b734e1b5573d5ef204fe2bf6ed6c26 Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Diffstat (limited to 'http/app.hpp')
-rw-r--r--http/app.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/http/app.hpp b/http/app.hpp
index d3afe60f05..a2892ced94 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -58,9 +58,11 @@ class App
App& operator=(const App&&) = delete;
template <typename Adaptor>
- void handleUpgrade(const Request& req, Response& res, Adaptor&& adaptor)
+ void handleUpgrade(const Request& req,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ Adaptor&& adaptor)
{
- router.handleUpgrade(req, res, std::forward<Adaptor>(adaptor));
+ router.handleUpgrade(req, asyncResp, std::forward<Adaptor>(adaptor));
}
void handle(Request& req,