diff options
author | Ed Tanous <edtanous@google.com> | 2023-05-18 20:30:34 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-05-19 20:47:39 +0300 |
commit | 81c4e3305281b2cfece8822f7c7114200ce4e12c (patch) | |
tree | 60563dba369c24a57bbcc21f6a172490e338a3f2 /http | |
parent | 4a40441f944aaff8d7bb2040e4d88ebfcebbab11 (diff) | |
download | bmcweb-81c4e3305281b2cfece8822f7c7114200ce4e12c.tar.xz |
Capture all boost::system::error_codes by ref
Capturing these possibly overloaded values by reference can avoid a copy
in some cases, and it's good to be consistent.
This change was made automatically by grep/sed.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iafeaca2a5dc52f39753b5a3880419d6bc943f81b
Diffstat (limited to 'http')
-rw-r--r-- | http/http_client.hpp | 6 | ||||
-rw-r--r-- | http/http_connection.hpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp index 8161eb1c5f..2b498b7fb8 100644 --- a/http/http_client.hpp +++ b/http/http_client.hpp @@ -169,7 +169,7 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> void afterResolve( const std::shared_ptr<ConnectionInfo>& /*self*/, - const boost::beast::error_code ec, + const boost::beast::error_code& ec, const std::vector<boost::asio::ip::tcp::endpoint>& endpointList) { if (ec || (endpointList.empty())) @@ -197,7 +197,7 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> } void afterConnect(const std::shared_ptr<ConnectionInfo>& /*self*/, - boost::beast::error_code ec, + const boost::beast::error_code& ec, const boost::asio::ip::tcp::endpoint& endpoint) { // The operation already timed out. We don't want do continue down @@ -246,7 +246,7 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> } void afterSslHandshake(const std::shared_ptr<ConnectionInfo>& /*self*/, - boost::beast::error_code ec) + const boost::beast::error_code& ec) { // The operation already timed out. We don't want do continue down // this branch diff --git a/http/http_connection.hpp b/http/http_connection.hpp index 213960214f..7b66ac851b 100644 --- a/http/http_connection.hpp +++ b/http/http_connection.hpp @@ -602,7 +602,7 @@ class Connection : std::weak_ptr<Connection<Adaptor, Handler>> weakSelf = weak_from_this(); timer.expires_after(timeout); - timer.async_wait([weakSelf](const boost::system::error_code ec) { + timer.async_wait([weakSelf](const boost::system::error_code& ec) { // Note, we are ignoring other types of errors here; If the timer // failed for any reason, we should still close the connection std::shared_ptr<Connection<Adaptor, Handler>> self = |