summaryrefslogtreecommitdiff
path: root/include/kvm_websocket.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-07-25 07:45:05 +0300
committerEd Tanous <ed@tanous.net>2020-08-17 23:54:37 +0300
commit23a21a1cbed23ace4174664950e595df961e9e69 (patch)
tree12e7cc9d9301642fc1e48332a0e0834c54e8c8af /include/kvm_websocket.hpp
parent52cc112d962920b035c870127784bcbd98948fad (diff)
downloadbmcweb-23a21a1cbed23ace4174664950e595df961e9e69.tar.xz
Enable clang warnings
This commit enables clang warnings, and fixes all warnings that were found. Most of these fall into a couple categories: Variable shadow issues were fixed by renaming variables unused parameter warnings were resolved by either checking error codes that had been ignored, or removing the name of the variable from the scope. Other various warnings were fixed in the best way I was able to come up with. Note, the redfish Node class is especially insidious, as it causes all imlementers to have variables for parameters, regardless of whether or not they are used. Deprecating the Node class is on my list of things to do, as it adds extra overhead, and in general isn't a useful abstraction. For now, I have simply fixed all the handlers. Tested: Added the current meta-clang meta layer into bblayers.conf, and added TOOLCHAIN_pn-bmcweb = "clang" to my local.conf Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
Diffstat (limited to 'include/kvm_websocket.hpp')
-rw-r--r--include/kvm_websocket.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/kvm_websocket.hpp b/include/kvm_websocket.hpp
index 4b56f23d67..f83c95b525 100644
--- a/include/kvm_websocket.hpp
+++ b/include/kvm_websocket.hpp
@@ -16,13 +16,13 @@ static constexpr const uint maxSessions = 4;
class KvmSession
{
public:
- explicit KvmSession(crow::websocket::Connection& conn) :
- conn(conn), hostSocket(conn.get_io_context()), doingWrite(false)
+ explicit KvmSession(crow::websocket::Connection& connIn) :
+ conn(connIn), hostSocket(conn.get_io_context()), doingWrite(false)
{
boost::asio::ip::tcp::endpoint endpoint(
boost::asio::ip::make_address("127.0.0.1"), 5900);
hostSocket.async_connect(
- endpoint, [this, &conn](const boost::system::error_code& ec) {
+ endpoint, [this, &connIn](const boost::system::error_code& ec) {
if (ec)
{
BMCWEB_LOG_ERROR
@@ -30,7 +30,7 @@ class KvmSession
<< ", Couldn't connect to KVM socket port: " << ec;
if (ec != boost::asio::error::operation_aborted)
{
- conn.close("Error in connecting to KVM port");
+ connIn.close("Error in connecting to KVM port");
}
return;
}
@@ -159,7 +159,7 @@ inline void requestRoutes(App& app)
sessions.reserve(maxSessions);
BMCWEB_ROUTE(app, "/kvm/0")
- .requires({"ConfigureComponents", "ConfigureManager"})
+ .privileges({"ConfigureComponents", "ConfigureManager"})
.websocket()
.onopen([](crow::websocket::Connection& conn,
std::shared_ptr<bmcweb::AsyncResp> asyncResp) {