http_client: Fixing invalid log

The error log for connection failures previously displayed an invalid
host name and port number because it retrieved these values from the
endpoint argument in the afterConnect callback, which is not valid when
the connection fails. This patch resolves the issue by obtaining the
host name directly from the connection object.

Tested By:
Attempted to subscribe to an unreachable host and sent test events to
verify that the error log was generated as expected.

Change-Id: I33772b224eb7ab164c2de342f35ae42c34126b3d
Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 6e5613b..cb67022 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -219,8 +219,8 @@
         if (ec)
         {
             BMCWEB_LOG_ERROR("Connect {}:{}, id: {} failed: {}",
-                             endpoint.address().to_string(), endpoint.port(),
-                             connId, ec.message());
+                             host.encoded_host_address(), host.port(), connId,
+                             ec.message());
             state = ConnState::connectFailed;
             waitAndRetry();
             return;