bmcweb: fetch ip address on every request in handle
The ip address is cleared out after req.emplace inside doWrite
function which leads to problem with ip address identification.
Fetch ip address on all handle requests instead of fetching on
connection's starts only.
Tested:
- no problems in filling of Request ip field with debug bmcweb build
Signed-off-by: Ivan Mikhaylov <i.mikhaylov@yadro.com>
Change-Id: Icc846285b987702a8db582434296d0d1b7f90b27
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index e654b24..6172b3a 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -282,9 +282,6 @@
startDeadline(0);
- // Fetch the client IP address
- readClientIp();
-
// TODO(ed) Abstract this to a more clever class with the idea of an
// asynchronous "start"
if constexpr (std::is_same_v<Adaptor,
@@ -311,6 +308,9 @@
{
cancelDeadlineTimer();
+ // Fetch the client IP address
+ readClientIp();
+
bool isInvalidRequest = false;
// Check for HTTP version 1.1.