summaryrefslogtreecommitdiff
path: root/include/vm_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/vm_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/vm_websocket.hpp')
-rw-r--r--include/vm_websocket.hpp7
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();
});
}