diff options
-rw-r--r-- | http/http2_connection.hpp | 2 | ||||
-rw-r--r-- | include/image_upload.hpp | 6 | ||||
-rw-r--r-- | redfish-core/lib/certificate_service.hpp | 6 | ||||
-rw-r--r-- | redfish-core/lib/update_service.hpp | 6 |
4 files changed, 20 insertions, 0 deletions
diff --git a/http/http2_connection.hpp b/http/http2_connection.hpp index d5f4481700..3e0c3943d5 100644 --- a/http/http2_connection.hpp +++ b/http/http2_connection.hpp @@ -246,6 +246,8 @@ class HTTP2Connection : } } crow::Request& thisReq = it->second.req; + thisReq.ioService = static_cast<decltype(thisReq.ioService)>( + &adaptor.get_executor().context()); BMCWEB_LOG_DEBUG("Handling {} \"{}\"", logPtr(&thisReq), thisReq.url().encoded_path()); diff --git a/include/image_upload.hpp b/include/image_upload.hpp index ef615cb3b8..8b3dc107c9 100644 --- a/include/image_upload.hpp +++ b/include/image_upload.hpp @@ -31,6 +31,12 @@ inline void asyncResp->res.result(boost::beast::http::status::service_unavailable); return; } + if (req.ioService == nullptr) + { + asyncResp->res.result( + boost::beast::http::status::internal_server_error); + return; + } // Make this const static so it survives outside this method static boost::asio::steady_timer timeout(*req.ioService, std::chrono::seconds(5)); diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp index 5dc4413821..6fba827371 100644 --- a/redfish-core/lib/certificate_service.hpp +++ b/redfish-core/lib/certificate_service.hpp @@ -766,6 +766,12 @@ inline void return; } + if (req.ioService == nullptr) + { + messages::internalError(asyncResp->res); + return; + } + // Make this static so it survives outside this method static boost::asio::steady_timer timeout(*req.ioService); timeout.expires_after(std::chrono::seconds(timeOut)); diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 9ef8311984..8617071e45 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -405,6 +405,12 @@ static void monitorForSoftwareAvailable( return; } + if (req.ioService == nullptr) + { + messages::internalError(asyncResp->res); + return; + } + fwAvailableTimer = std::make_unique<boost::asio::steady_timer>(*req.ioService); |