summaryrefslogtreecommitdiff
path: root/http/websocket.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-02-16 21:37:01 +0300
committerEd Tanous <ed@tanous.net>2023-02-24 20:21:40 +0300
commit5e7e2dc585dc7a7e62d2b648b541e7f50c39ea5d (patch)
treeee3993e0fb2dc6e244a5fc31c7e83b26783161ee /http/websocket.hpp
parent26ccae32112679c4653c1e3f8a1203c828bea05c (diff)
downloadbmcweb-5e7e2dc585dc7a7e62d2b648b541e7f50c39ea5d.tar.xz
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
Diffstat (limited to 'http/websocket.hpp')
-rw-r--r--http/websocket.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/http/websocket.hpp b/http/websocket.hpp
index c36e579ea8..f17ee5e7d0 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -138,7 +138,7 @@ class ConnectionImpl : public Connection
// Perform the websocket upgrade
ws.async_accept(req, [this, self(shared_from_this())](
- boost::system::error_code ec) {
+ const boost::system::error_code& ec) {
if (ec)
{
BMCWEB_LOG_ERROR << "Error in ws.async_accept " << ec;
@@ -180,7 +180,7 @@ class ConnectionImpl : public Connection
{
ws.async_close(
{boost::beast::websocket::close_code::normal, msg},
- [self(shared_from_this())](boost::system::error_code ec) {
+ [self(shared_from_this())](const boost::system::error_code& ec) {
if (ec == boost::asio::error::operation_aborted)
{
return;