diff options
author | Ed Tanous <ed@tanous.net> | 2024-03-28 02:31:46 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-07 21:09:42 +0300 |
commit | 8cb2c024c4625e2fe2f0b107a865faffcd4bb770 (patch) | |
tree | 252d85214747ab3b9ae784b08b0f07ec31ea0c13 /http/websocket.hpp | |
parent | dce4d230c52978fc258ee3bc31117389d9c25388 (diff) | |
download | bmcweb-8cb2c024c4625e2fe2f0b107a865faffcd4bb770.tar.xz |
Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which
catches quite a few "wrong" things where we were making copies of
callback handlers.
Unfortunately, the lambda syntax of
callback{std::forward<Callback>(callback)}
in a capture confuses it, so change usages to
callback = std::forward<Callback>(callback)
to be consistent.
Tested: Redfish service validator passes.
Change-Id: I7a111ec00cf78ecb7d5f5b102c786c1c14d74384
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'http/websocket.hpp')
-rw-r--r-- | http/websocket.hpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/http/websocket.hpp b/http/websocket.hpp index 2ef8412886..4262c70a5c 100644 --- a/http/websocket.hpp +++ b/http/websocket.hpp @@ -36,11 +36,9 @@ struct Connection : std::enable_shared_from_this<Connection> Connection& operator=(const Connection&&) = delete; virtual void sendBinary(std::string_view msg) = 0; - virtual void sendBinary(std::string&& msg) = 0; virtual void sendEx(MessageType type, std::string_view msg, std::function<void()>&& onDone) = 0; virtual void sendText(std::string_view msg) = 0; - virtual void sendText(std::string&& msg) = 0; virtual void close(std::string_view msg = "quit") = 0; virtual void deferRead() = 0; virtual void resumeRead() = 0; @@ -181,14 +179,6 @@ class ConnectionImpl : public Connection }); } - void sendBinary(std::string&& msg) override - { - ws.binary(true); - outBuffer.commit(boost::asio::buffer_copy(outBuffer.prepare(msg.size()), - boost::asio::buffer(msg))); - doWrite(); - } - void sendText(std::string_view msg) override { ws.text(true); @@ -197,14 +187,6 @@ class ConnectionImpl : public Connection doWrite(); } - void sendText(std::string&& msg) override - { - ws.text(true); - outBuffer.commit(boost::asio::buffer_copy(outBuffer.prepare(msg.size()), - boost::asio::buffer(msg))); - doWrite(); - } - void close(std::string_view msg) override { ws.async_close( |