summaryrefslogtreecommitdiff
path: root/http/http_client.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-06-29 05:41:44 +0300
committerEd Tanous <ed@tanous.net>2022-07-05 07:56:31 +0300
commit6b3db60d9ae96a791fe976cee032e79d0eed090e (patch)
tree71cade8f8d8703751413f8e4d5aa120d9e052c29 /http/http_client.hpp
parent768989b142c5d94e0b63d98c86ad37f950d14e26 (diff)
downloadbmcweb-6b3db60d9ae96a791fe976cee032e79d0eed090e.tar.xz
Make resHandler const
cppcheck correctly notes this parameter can be const. Unfortunately we've making a copy here, but looking at the ownership, that can't be avoided simply without a shared_ptr, and that's far more invasive. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib70c89a7a1bc7210219052ba2a44bc7a1c20c7f2
Diffstat (limited to 'http/http_client.hpp')
-rw-r--r--http/http_client.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp
index fe5ef8ecfa..1568b25c19 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -503,7 +503,7 @@ class ConnectionPool : public std::enable_shared_from_this<ConnectionPool>
const boost::beast::http::fields& httpHeader,
const boost::beast::http::verb verb,
const RetryPolicyData& retryPolicy,
- std::function<void(Response&)>& resHandler)
+ const std::function<void(Response&)>& resHandler)
{
std::weak_ptr<ConnectionPool> weakSelf = weak_from_this();
@@ -674,7 +674,7 @@ class HttpClient
const boost::beast::http::fields& httpHeader,
const boost::beast::http::verb verb,
const std::string& retryPolicyName,
- std::function<void(Response&)>& resHandler)
+ const std::function<void(Response&)>& resHandler)
{
std::string clientKey = destIP + ":" + std::to_string(destPort);
// Use nullptr to avoid creating a ConnectionPool each time