Remove getIoContext from Request object
At one point it was thought that we could pass the io_context object
through the request object, and have the potential to run multiple
io_context instances (one per connection).
Given the safety refactoring we had to do in
9838eb20341568971b9543c2187372d20daf64aa that idea is on ice for the
moment, and would need a major rethink of code to be viable. For the
moment, and in prep for
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75668
make sure all calls are pulling from the same io object.
Tested: Unit tests pass. Redfish service validator passes.
Change-Id: I877752005c4ce94efbc13ce815f3cd0d99cc3d51
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 6efcab5..5c8d75d 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -14,6 +14,7 @@
#include "generated/enums/update_service.hpp"
#include "http_request.hpp"
#include "http_response.hpp"
+#include "io_context_singleton.hpp"
#include "logging.hpp"
#include "multipart_parser.hpp"
#include "ossl_random.hpp"
@@ -458,14 +459,8 @@
return;
}
- if (req.ioService == nullptr)
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
fwAvailableTimer =
- std::make_unique<boost::asio::steady_timer>(*req.ioService);
+ std::make_unique<boost::asio::steady_timer>(getIoContext());
fwAvailableTimer->expires_after(std::chrono::seconds(timeoutTimeSeconds));