diff options
author | Ed Tanous <ed@tanous.net> | 2024-04-06 23:48:50 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-11 19:38:16 +0300 |
commit | 44106f346d79f6d740d4f756fe55ece78bb7feed (patch) | |
tree | a83d6c7f3fe6d8606c291a17fd92a6eb265c5b77 /include/vm_websocket.hpp | |
parent | 4a7fbefdff330f06d5698a1e60ce893225cd389e (diff) | |
download | bmcweb-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/vm_websocket.hpp')
-rw-r--r-- | include/vm_websocket.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp index 13bbdc6b23..19054a6d97 100644 --- a/include/vm_websocket.hpp +++ b/include/vm_websocket.hpp @@ -215,9 +215,10 @@ inline void requestRoutes(App& app) return; } - boost::asio::buffer_copy(handler->inputBuffer->prepare(data.size()), - boost::asio::buffer(data)); - handler->inputBuffer->commit(data.size()); + size_t copied = + boost::asio::buffer_copy(handler->inputBuffer->prepare(data.size()), + boost::asio::buffer(data)); + handler->inputBuffer->commit(copied); handler->doWrite(); }); } |