diff options
author | John Edward Broadbent <jebr@google.com> | 2021-07-20 02:52:24 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-08-23 22:31:36 +0300 |
commit | 4147b8ac88c79949f2f9f5c2738aca53641e22c8 (patch) | |
tree | 554defc6d03e00a6131186cb366f33c6a6a6ca2a /http/http_connection.hpp | |
parent | 8338891aa2c5424c52fe3e0bea320172a5aedda3 (diff) | |
download | bmcweb-4147b8ac88c79949f2f9f5c2738aca53641e22c8.tar.xz |
connection use setter for completeRequestHandler
The Connection object used to set the response object public member.
However, it is cleaner when public interfaces are used.
Change-Id: Ib16950f174106e5fd22aad874f09f31704283ad1
Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'http/http_connection.hpp')
-rw-r--r-- | http/http_connection.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/http/http_connection.hpp b/http/http_connection.hpp index 4df9300c14..a1a7045c03 100644 --- a/http/http_connection.hpp +++ b/http/http_connection.hpp @@ -84,7 +84,7 @@ class Connection : ~Connection() { - res.completeRequestHandler = nullptr; + res.setCompleteRequestHandler(nullptr); cancelDeadlineTimer(); #ifdef BMCWEB_ENABLE_DEBUG connectionCount--; @@ -337,7 +337,7 @@ class Connection : if (!isInvalidRequest) { - res.completeRequestHandler = [] {}; + res.setCompleteRequestHandler(nullptr); res.isAliveHelper = [this]() -> bool { return isAlive(); }; req->ioService = static_cast<decltype(req->ioService)>( @@ -346,10 +346,10 @@ class Connection : if (!res.completed) { needToCallAfterHandlers = true; - res.completeRequestHandler = [self(shared_from_this())] { + res.setCompleteRequestHandler([self(shared_from_this())] { boost::asio::post(self->adaptor.get_executor(), [self] { self->completeRequest(); }); - }; + }); if (req->isUpgrade() && boost::iequals( req->getHeaderValue(boost::beast::http::field::upgrade), @@ -358,7 +358,7 @@ class Connection : handler->handleUpgrade(*req, res, std::move(adaptor)); // delete lambda with self shared_ptr // to enable connection destruction - res.completeRequestHandler = nullptr; + res.setCompleteRequestHandler(nullptr); return; } auto asyncResp = std::make_shared<bmcweb::AsyncResp>(res); @@ -432,7 +432,7 @@ class Connection : // delete lambda with self shared_ptr // to enable connection destruction - res.completeRequestHandler = nullptr; + res.setCompleteRequestHandler(nullptr); return; } if (res.body().empty() && !res.jsonValue.empty()) @@ -472,7 +472,7 @@ class Connection : // delete lambda with self shared_ptr // to enable connection destruction - res.completeRequestHandler = nullptr; + res.setCompleteRequestHandler(nullptr); } void readClientIp() |