Clean up static analysis
Coverity marks some minor things as improvements we can make.
Clean up the code to silence the errors.
Tested: Unit tests coverage for http core is sufficient.
Change-Id: If4efb359792bfdfe3866e843b4bbdb3f83fec0c5
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/http/app.hpp b/http/app.hpp
index b5f5c13..08748a3 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -43,15 +43,6 @@
std::make_shared<boost::asio::io_context>()) :
io(std::move(ioIn))
{}
- ~App()
- {
- stop();
- }
-
- App(const App&) = delete;
- App(App&&) = delete;
- App& operator=(const App&) = delete;
- App& operator=(const App&&) = delete;
template <typename Adaptor>
void handleUpgrade(const std::shared_ptr<Request>& req,
@@ -101,8 +92,7 @@
return std::nullopt;
}
constexpr int defaultPort = 18080;
- int listenFd = sd_listen_fds(0);
- if (listenFd == 1)
+ if (sd_listen_fds(0) == 1)
{
BMCWEB_LOG_INFO("attempting systemd socket activation");
if (sd_is_socket_inet(SD_LISTEN_FDS_START, AF_UNSPEC, SOCK_STREAM,
@@ -137,11 +127,6 @@
server->run();
}
- void stop()
- {
- io->stop();
- }
-
void debugPrint()
{
BMCWEB_LOG_DEBUG("Routing:");
diff --git a/http/http_client.hpp b/http/http_client.hpp
index b48fc6a..db426d6 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -318,8 +318,7 @@
{
state = ConnState::recvInProgress;
- parser_type& thisParser =
- parser.emplace(std::piecewise_construct, std::make_tuple());
+ parser_type& thisParser = parser.emplace();
thisParser.body_limit(connPolicy->requestByteLimit);
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 29d4fc8..927b825 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -228,7 +228,7 @@
void initParser()
{
boost::beast::http::request_parser<bmcweb::HttpBody>& instance =
- parser.emplace(std::piecewise_construct, std::make_tuple());
+ parser.emplace();
// reset header limit for newly created parser
instance.header_limit(httpHeaderLimit);