diff options
author | Ed Tanous <edtanous@google.com> | 2022-06-29 05:40:39 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-07-02 02:02:11 +0300 |
commit | ca723762cdc83a2ad0bc75807d287abce219636d (patch) | |
tree | 665610769092381e74f676d816a91fc61f9d5674 /http/http_client.hpp | |
parent | e3009e4645d3a4ecaf2e65f75c6b997a5ed5dbfb (diff) | |
download | bmcweb-ca723762cdc83a2ad0bc75807d287abce219636d.tar.xz |
Fix unused branches in http_client
cppcheck correctly finds that these branches will always be hit, so the
branch is unneeded. Let's start by getting the code cleaned up.
Tested: CI only, cpp check.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7b89337a81e676915243d5bc9d26c24a89c74aef
Diffstat (limited to 'http/http_client.hpp')
-rw-r--r-- | http/http_client.hpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp index 14e2cf263f..ca350c7e57 100644 --- a/http/http_client.hpp +++ b/http/http_client.hpp @@ -371,10 +371,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port) << ", id: " << std::to_string(connId) << " closed gracefully"; - if ((state != ConnState::suspended) && (state != ConnState::terminated)) - { - state = ConnState::closed; - } + + state = ConnState::closed; } void doCloseAndRetry() @@ -395,12 +393,10 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> BMCWEB_LOG_DEBUG << host << ":" << std::to_string(port) << ", id: " << std::to_string(connId) << " closed gracefully"; - if ((state != ConnState::suspended) && (state != ConnState::terminated)) - { - // Now let's try to resend the data - state = ConnState::retry; - this->doResolve(); - } + + // Now let's try to resend the data + state = ConnState::retry; + doResolve(); } public: |