summaryrefslogtreecommitdiff
path: root/include/kvm_websocket.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-04-06 23:48:50 +0300
committerEd Tanous <ed@tanous.net>2024-04-11 19:38:16 +0300
commit44106f346d79f6d740d4f756fe55ece78bb7feed (patch)
treea83d6c7f3fe6d8606c291a17fd92a6eb265c5b77 /include/kvm_websocket.hpp
parent4a7fbefdff330f06d5698a1e60ce893225cd389e (diff)
downloadbmcweb-44106f346d79f6d740d4f756fe55ece78bb7feed.tar.xz
Fix buffer_copy
boost::asio::buffer_copy returns an integer of the number of values copied. Some static analysis tools mark that value as nodiscard, although it should never fail. Audit all uses of buffer_copy, and make sure that they're using the return value. In theory this should have no change on the behavior. Change-Id: I6af39b5347954c2932cf3d4e48e96ff9ae01583a Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'include/kvm_websocket.hpp')
-rw-r--r--include/kvm_websocket.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/kvm_websocket.hpp b/include/kvm_websocket.hpp
index 0089ae375b..df13a67461 100644
--- a/include/kvm_websocket.hpp
+++ b/include/kvm_websocket.hpp
@@ -52,11 +52,11 @@ class KvmSession : public std::enable_shared_from_this<KvmSession>
BMCWEB_LOG_DEBUG("conn:{}, Read {} bytes from websocket", logPtr(&conn),
data.size());
- boost::asio::buffer_copy(inputBuffer.prepare(data.size()),
- boost::asio::buffer(data));
+ size_t copied = boost::asio::buffer_copy(
+ inputBuffer.prepare(data.size()), boost::asio::buffer(data));
BMCWEB_LOG_DEBUG("conn:{}, Committing {} bytes from websocket",
- logPtr(&conn), data.size());
- inputBuffer.commit(data.size());
+ logPtr(&conn), copied);
+ inputBuffer.commit(copied);
BMCWEB_LOG_DEBUG("conn:{}, inputbuffer size {}", logPtr(&conn),
inputBuffer.size());