]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.h
Fix logging of responses truncated by premature EOF (#1244)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 28 Jan 2023 09:36:56 +0000 (09:36 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 29 Jan 2023 18:11:51 +0000 (18:11 +0000)
commit21f90159029aeb05fca55a6f48f120afb5f2b705
tree5d0d0cae3c2c5a670f337d4541c8f3581a10d946
parent0b5786d3ad61e139d0f533450b64d6376614a26a
Fix logging of responses truncated by premature EOF (#1244)

When a transaction failed due to a premature EOF while receiving an HTTP
response, %Ss logformat code was missing the ABORTED suffix (e.g.,
logging TCP_MISS instead of TCP_MISS_ABORTED). When premature EOF
truncated the header, the default "squid" access log format contained a
502 sent status code (%>Hs), hinting at the problem. When the body was
truncated, even that weak hint was usually absent because the actual
status code returned by the server (usually 200) was usually logged.

Similarly, %err_code/%err_detail logformat codes for HTTP responses with
truncated by a premature EOF bodies carried no information. Now they
expand to ERR_READ_ERROR/SRV_PREMATURE_EOF in those cases.

No changes to requests truncated by Squid-server read timeouts. They
were and are still logged with TIMEDOUT %Ss suffix and
ERR_READ_TIMEOUT/WITH_SERVER %err_code/%err_detail.

Also adjusted WHOIS to mark zero-length responses with
ERR_ZERO_SIZE_OBJECT instead of default ERR_READ_ERROR. This affects
forwarded WHOIS transactions and AS number queries generated during
(re)configuration.
doc/release-notes/release-6.sgml
src/FwdState.cc
src/http.cc
src/http.h
src/whois.cc