<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On Wednesday 02 May 2018 10:05 AM, Amos Jeffries wrote:<br>
<blockquote type="cite"
cite="mid:c1acd07e-e685-7ef2-5e6a-cb4b8701994c@treenet.co.nz">
<pre wrap="">On 02/05/18 16:20, Amish wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
Does request->masterXaction->tcpClient->local hold Squid IP incase of
intercepted traffic too?
</pre>
</blockquote>
<pre wrap="">
The listening address (if any) will be in
request->masterXaction->squidPort->listenConn->local instead. It has no
relation to the client TCP connection and may be :: or 0.0.0.0.
In this chain case request, squidPort, and listenConn may be nil.
Amos
_______________________________________________
squid-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squid-cache.org/listinfo/squid-users">http://lists.squid-cache.org/listinfo/squid-users</a>
</pre>
</blockquote>
<br>
I am getting confused actually.<br>
<br>
Squid 3.5<br>
<a class="moz-txt-link-freetext" href="http://www.squid-cache.org/Versions/v3/3.5/cfgman/external_acl_type.html">http://www.squid-cache.org/Versions/v3/3.5/cfgman/external_acl_type.html</a><br>
<br>
Above says %MYADDR = Squid interface address<br>
<br>
Squid 4 (external_acl_type uses logformat FORMATs)<br>
And <a class="moz-txt-link-freetext" href="http://www.squid-cache.org/Doc/config/logformat/">http://www.squid-cache.org/Doc/config/logformat/</a><br>
<br>
This says %la = Local listening IP address the client connection was
connected to<br>
<br>
So description of %MYADDR and %la is different, but from source code
(src/format/Token.cc) both appear to be same thing i.e.
LFT_LOCAL_LISTENING_IP<br>
<br>
But the code in Format.cc looks complicated then simple one line:<br>
<br>
case LFT_LOCAL_LISTENING_IP: {<br>
// avoid logging a dash if we have reliable info<br>
const bool interceptedAtKnownPort = al->request ?<br>
(al->request->flags.interceptTproxy ||<br>
al->request->flags.intercepted) && al->cache.port
!= NULL :<br>
false;<br>
if (interceptedAtKnownPort) {<br>
const bool portAddressConfigured =
!al->cache.port->s.isAnyAddr();<br>
if (portAddressConfigured)<br>
out = al->cache.port->s.toStr(tmp,
sizeof(tmp));<br>
} else if (al->tcpClient != NULL)<br>
out = al->tcpClient->local.toStr(tmp,
sizeof(tmp));<br>
}<br>
<br>
So which is right way? Above code which considers interception too?<br>
<br>
OR one of the lines below?<br>
<br>
request->masterXaction->tcpClient->local<br>
request->masterXaction->squidPort->listenConn->local<br>
<br>
i.e. something like (in errorpage.cc)<br>
case 'A':<br>
if (request && request->masterXaction->squidPort
&& request->masterXaction->squidPort->listenConn) <br>
mb.appendf("%s",
request->masterXaction->squidPort->listenConn->local.toStr(ntoabuf,MAX_IPSTRLEN));<br>
else<br>
mb.<span class="pl-c1">appendf</span>(<span class="pl-s"><span
class="pl-pds">"</span>%s<span class="pl-pds">"</span></span>, <span
class="pl-c1">getMyHostname</span>());<br>
<br>
<br>
Note: Here %A would be same as %h if required information is not
available.<br>
<br>
Amish.<br>
<br>
PS: Off for few days vacation - so may not be able to reply<br>
</body>
</html>