On Tue, 06 Sep 2011 19:04:29 +0300, Tsantilas Christos wrote:
I am sending a new patch  which does not touch the current ">la"
formating code but instead adjust the "la" formatting code to follow
rules as discussed by Amos.

Please look in the cf.data.per documentation and the
LFT_CLIENT_LOCAL_USED_IP/LFT_CLIENT_LOCAL_USED_PORT enum names I am
using...


* LFT_LOCAL_LISTENING_ would be a bit more descriptive for the enum. The documentation could also use the word "listening" to be clearer on where it comes from.
 ie:
+               la      Local listening IP address the client connection uses.
+               lp      Local listening port number the client connection uses.


* The IP address display needs a re-structure. al->tcpClient is possibly a backup source on non-intercepted requests if cache.port->s.IsAnyAddr() [only this case]. Otherwise always use cache.port->s or dash.

+        case LFT_LOCAL_LISTENING_IP:
+            if (al->cache.port == NULL) {
+                break; // dash
+            } else if (al->cache.port->s.IsAnyAddr()) {
+                if (al->tcpClient != NULL &&
+ !(al->request != NULL && (al->request->flags.spoof_client_ip || al->request->flags.intercepted))) {
+                    out = al->tcpClient->local.NtoA(tmp, sizeof(tmp));
+                } // else dash.
+            } else {
+                out = al->cache.port->s.NtoA(tmp, sizeof(tmp));
+            }
+            break;


* Drop all use of al->tcpClient and traffic types out of the port display code. To match the documentation cache.port->s should always be set when cache.port != NULL. If its missing from a particular path that needs to be known why (internally generated requests would be 0, others should not ever be).

+        case LFT_LOCAL_LISTENING_PORT:
+            if (al->cache.port) {
+                outint = al->cache.port->s.GetPort();
+                doint = 1;
+            }
+            break;


* Drop the deprecation warning added for *_OLD_31 entirely now. That will prevent the altered codes having any effect.


Amos


On 09/01/2011 12:08 AM, Amos Jeffries wrote:
%>la to always display tcpClient->local with a config documentation note
about it being external IPs in intercepted traffic.

%la to display cache.caddr with a config documentation note that it is the squid receiving *_port details as known by Squid (caddr also used by
icp_port and htcp_port on their messages).

Amos

Reply via email to