]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AccessLogEntry.cc
Renamed squid.h to squid-old.h and config.h to squid.h
[thirdparty/squid.git] / src / AccessLogEntry.cc
1 #include "squid.h"
2 #include "AccessLogEntry.h"
3 #include "HttpRequest.h"
4
5 void
6 AccessLogEntry::getLogClientIp(char *buf, size_t bufsz) const
7 {
8 #if FOLLOW_X_FORWARDED_FOR
9 if (Config.onoff.log_uses_indirect_client && request)
10 request->indirect_client_addr.NtoA(buf, bufsz);
11 else
12 #endif
13 if (tcpClient != NULL)
14 tcpClient->remote.NtoA(buf, bufsz);
15 else if (cache.caddr.IsNoAddr()) // e.g., ICAP OPTIONS lack client
16 strncpy(buf, "-", 1);
17 else
18 cache.caddr.NtoA(buf, bufsz);
19 }