Using AsyncResp everywhere
Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended after the first tree is done populating.
Don't use res.end() anymore.
Tested:
1. Validator passed.
Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 19175e7..cd4faa4 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -28,11 +28,11 @@
struct HealthPopulate : std::enable_shared_from_this<HealthPopulate>
{
- HealthPopulate(const std::shared_ptr<AsyncResp>& asyncRespIn) :
+ HealthPopulate(const std::shared_ptr<bmcweb::AsyncResp>& asyncRespIn) :
asyncResp(asyncRespIn), jsonStatus(asyncResp->res.jsonValue["Status"])
{}
- HealthPopulate(const std::shared_ptr<AsyncResp>& asyncRespIn,
+ HealthPopulate(const std::shared_ptr<bmcweb::AsyncResp>& asyncRespIn,
nlohmann::json& status) :
asyncResp(asyncRespIn),
jsonStatus(status)
@@ -214,7 +214,7 @@
"org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
}
- std::shared_ptr<AsyncResp> asyncResp;
+ std::shared_ptr<bmcweb::AsyncResp> asyncResp;
nlohmann::json& jsonStatus;
// we store pointers to other HealthPopulate items so we can update their