aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpsys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp/servers/httpsys.cpp')
-rw-r--r--src/zenhttp/servers/httpsys.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp
index 9fe9a2254..2cad97725 100644
--- a/src/zenhttp/servers/httpsys.cpp
+++ b/src/zenhttp/servers/httpsys.cpp
@@ -2020,6 +2020,23 @@ HttpSysTransaction::InvokeRequestHandler(HttpService& Service, IoBuffer Payload)
m_HttpServer.MarkRequest();
+ // Track distinct client addresses
+ {
+ const SOCKADDR* SockAddr = HttpRequest()->Address.pRemoteAddress;
+ if (SockAddr->sa_family == AF_INET)
+ {
+ const SOCKADDR_IN* V4 = reinterpret_cast<const SOCKADDR_IN*>(SockAddr);
+ m_HttpServer.MarkClientAddress(&V4->sin_addr, sizeof(V4->sin_addr));
+ }
+ else if (SockAddr->sa_family == AF_INET6)
+ {
+ const SOCKADDR_IN6* V6 = reinterpret_cast<const SOCKADDR_IN6*>(SockAddr);
+ m_HttpServer.MarkClientAddress(&V6->sin6_addr, sizeof(V6->sin6_addr));
+ }
+ }
+
+ m_HttpServer.MarkSessionId(ThisRequest.SessionId());
+
// Default request handling
# if ZEN_WITH_OTEL