On Wednesday 02 May 2018 09:11 PM, Amos Jeffries wrote:
On 03/05/18 03:01, Amish wrote:
But the code in Format.cc looks complicated then simple one line:
case LFT_LOCAL_LISTENING_IP: {
// avoid logging a dash if we have reliable info
const bool interceptedAtKnownPort = al->request ?
(al->request->flags.interceptTproxy ||
al->request->flags.intercepted) && al->cache.port != NULL :
false;
if (interceptedAtKnownPort) {
const bool portAddressConfigured =
!al->cache.port->s.isAnyAddr();
if (portAddressConfigured)
out = al->cache.port->s.toStr(tmp, sizeof(tmp));
} else if (al->tcpClient != NULL)
out = al->tcpClient->local.toStr(tmp, sizeof(tmp));
}
So which is right way? Above code which considers interception too?
The above is the right logic to work with both types of traffic. Except
that code is working from an 'ALE' object "al". The error page code you
are working with does not currently have access to that.
NP: The TCP connection data is more reliable (never being :: or
0.0.0.0). But when interception is happening the TCP details are only
about client and server, not Squid - so the port config has to be used.
The Convert() equivalent of "al->request" is just "request".
The Convert() equivalent of "al->tcpClient" is
"request->masterXaction->tcpClient".
The Convert() equivalent of "al->cache.port" is
"request->masterXaction->squidPort".
OR one of the lines below?
request->masterXaction->tcpClient->local
request->masterXaction->squidPort->listenConn->local
These are the variables where you find the data. You still have to use
the logic from (or similar to) "case LFT_LOCAL_LISTENING_IP" to produce
the right value from them for both intercepted and non-intercepted traffic.
Created PR:
https://github.com/squid-cache/squid/pull/198
May be any further discussion can now continue there.
Thank you
Amish
Amos
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users