summaryrefslogtreecommitdiff
path: root/redfish-core/lib/sensors.hpp
diff options
context:
space:
mode:
authorzhanghch05 <zhanghch05@inspur.com>2021-10-20 13:43:55 +0300
committerEd Tanous <ed@tanous.net>2021-11-16 01:56:22 +0300
commit91995f3272010875e1559397e98ca93354066a0e (patch)
tree82704b2dd24a1f149e8dd6901e7936825ca4474c /redfish-core/lib/sensors.hpp
parentf6674220424eaacda4450a50e8650dc04399126f (diff)
downloadbmcweb-91995f3272010875e1559397e98ca93354066a0e.tar.xz
Change the completionhandler to accept Res
These modifications are from WIP:Redfish:Query parameters:Only (https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/47474). And they will be used in Redfish:Query Parameters:Only. (https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38952) The code changed the completion handle to accept Res to be able to recall handle with a new Response object. AsyncResp owns a new res, so there is no need to pass in a res. Tested: 1.Basic and Token auth both still work. 2.Use scripts/websocket_test.py to test websockets. It is still work correctly. python3 websocket_test.py --host 127.0.0.1:2443 This modification is a public part, so you can use any URL to test this function. The response is the same as before. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I570e32fb47a9a90fe111fcd1f4054060cd21def3
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r--redfish-core/lib/sensors.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index af9f466e28..efbb98026d 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2972,10 +2972,9 @@ inline void retrieveUriToDbusMap(const std::string& chassis,
return;
}
- auto res = std::make_shared<crow::Response>();
- auto asyncResp = std::make_shared<bmcweb::AsyncResp>(*res);
+ auto asyncResp = std::make_shared<bmcweb::AsyncResp>();
auto callback =
- [res, asyncResp, mapCompleteCb{std::move(mapComplete)}](
+ [asyncResp, mapCompleteCb{std::move(mapComplete)}](
const boost::beast::http::status status,
const boost::container::flat_map<std::string, std::string>&
uriToDbus) { mapCompleteCb(status, uriToDbus); };