]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5148: Log %Ss of failed tunnels as TCP_TUNNEL (#1354)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 20 May 2023 21:38:38 +0000 (21:38 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Mon, 22 May 2023 12:16:51 +0000 (00:16 +1200)
commit670180f80ac05d65b30af7ef7ea26fb619df101f
treef20b99575dc245c58c9216a02ad694a210aff241
parentd241e6feadc6678edafdfedd235d93987af2d778
Bug 5148: Log %Ss of failed tunnels as TCP_TUNNEL (#1354)

    ERR_CONNECT_FAIL/errno=111 NONE_NONE/503 CONNECT

    TAG_NONE/503 0 CONNECT example.com:443 - HIER_NONE/- -

When Squid failed to open a TCP connection to an origin server (or
through a cache peer) while handling a CONNECT request, Squid logged %Ss
as NONE_NONE because TunnelStateData waited for a successful TCP
connection to update the log tag. That unnecessary wait (modeled after
the necessary HTTP status code wait) complicated code. Squid now logs
TCP_TUNNEL to indicate the request handling path chosen by Squid.

We already use the same "handling path" approach for most other request
status codes. For example, TCP_MISS does not mean the miss transaction
was successful. It only means that Squid satisfied the request using the
cache miss forwarding logic. Even the LOG_TCP_REFRESH_FAIL_ERR status
code does not imply that the error response was successfully forwarded
to the client; only that the request was satisfied on a particular
(albeit very detailed in this case!) handling path.

Apply the same logic to tunneling attempts blocked by miss_access. They
were also logged as NONE_NONE and are now logged as TCP_TUNNEL.

The actual outcome of a tunneling attempt can usually be determined
using %err_code/%err_detail and %>Hs logformat codes.
doc/release-notes/release-6.sgml.in
src/LogTags.h
src/tunnel.cc