Skip to content

Add format codes for local FQDN#2429

Open
yadij wants to merge 2 commits into
squid-cache:masterfrom
yadij:arc-logformat-1
Open

Add format codes for local FQDN#2429
yadij wants to merge 2 commits into
squid-cache:masterfrom
yadij:arc-logformat-1

Conversation

@yadij

@yadij yadij commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@yadij yadij added the feature maintainer needs documentation updates for merge label Jun 2, 2026
Comment thread src/cf.data.pre
<A Server FQDN or peer name
<p Server port number of the last server or peer connection
<la Local IP address of the last server or peer connection
<lA Local FQDN for address of the last server or peer connection

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere in this PR, please avoid the term "local FQDN". It is confusing (e.g., was some special a "local" DNS resolver used to obtain that FQDN?) and not descriptive enough ("address of the last server or peer connection" matches two different addresses, not one).

I do not insist on any specific wording, but something like this would address the problem:

Suggested change
<lA Local FQDN for address of the last server or peer connection
<lA FQDN for the local (a.k.a. source) address of the last Squid-to-server (including Squid-to-cache_peer) TCP connection

N.B. LFT_CLIENT_LOCAL_FQDN and LFT_SERVER_LOCAL_FQDN do not need to be renamed. In that existing naming pattern, "local" binds to "from-client" and "to-server" connection rather than binding to "FQDN".

Comment thread src/format/Format.cc
break;

case LFT_CLIENT_LOCAL_FQDN:
// May be too late for ours, but FQDN_LOOKUP_IF_MISS might help the next caller.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mimic existing Dns::ResolveClientAddressesAsap logic to enable "early" or "as soon as possible" DNS lookups of these addresses.

I suggest naming the new flag ResolveClientLocalAddressesAsap and renaming the old flag to ResolveClientRemoteAddressesAsap. Using ResolveLocalClientAddressesAsap and ResolveRemoteClientAddressesAsap is also OK but does not match our LFT_CLIENT_LOCAL_FQDN naming pattern.

Same for tcpServer->local lookups, of course -- Dns::ResolveServerLocalAddressesAsap.

Comment thread src/cf.data.pre
>p Client source port
>eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier)
>la Local IP address the client connected to
>lA Local FQDN for address the client connected to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document (in cf.dada.pre) that these FQDNs are provided on a best-effort basis (i.e. that, when the corresponding DNS lookups are needed, Squid does not wait for them to complete when logging transactions).

Comment thread src/format/Token.cc
TokenTableEntry("lp", LFT_LOCAL_LISTENING_PORT),

TokenTableEntry("la", LFT_LOCAL_LISTENING_IP),
/*TokenTableEntry( "lA", LFT_LOCAL_NAME ), */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this old commented out code, especially since this PR is already moving around unchanged entries. Even if LFT_LOCAL_NAME was meant to represent something other than one of the %codes added in this PR, it is very unlikely to be added under that old name, especially after this PR is merged...

Suggested change
/*TokenTableEntry( "lA", LFT_LOCAL_NAME ), */

Comment thread src/format/ByteCode.h
LFT_CLIENT_LOCAL_IP,
LFT_CLIENT_LOCAL_FQDN,
LFT_CLIENT_LOCAL_PORT,
/*LFT_CLIENT_LOCAL_FQDN, (rDNS) */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*LFT_CLIENT_LOCAL_FQDN, (rDNS) */

@rousskov rousskov added the S-waiting-for-author author action is expected (and usually required) label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature maintainer needs documentation updates for merge S-waiting-for-author author action is expected (and usually required)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants