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 /http | |
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 'http')
-rw-r--r-- | http/server_sent_event.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/http/server_sent_event.hpp b/http/server_sent_event.hpp index 0e1cd62a9d..1b644fc84e 100644 --- a/http/server_sent_event.hpp +++ b/http/server_sent_event.hpp @@ -228,9 +228,9 @@ class ConnectionImpl : public Connection } rawData += "\n\n"; - boost::asio::buffer_copy(inputBuffer.prepare(rawData.size()), - boost::asio::buffer(rawData)); - inputBuffer.commit(rawData.size()); + size_t copied = boost::asio::buffer_copy( + inputBuffer.prepare(rawData.size()), boost::asio::buffer(rawData)); + inputBuffer.commit(copied); } void startTimeout() |