]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5278: Log %err_code for "early" request handling errors (#1382)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 17 Jun 2023 16:34:11 +0000 (16:34 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 17 Jun 2023 21:08:40 +0000 (21:08 +0000)
commit8a628a131c8fd85b737e918f0d7e74b622fe3a5d
tree26898134967b6b8cb840237792d8484f62fa7f5e
parente37329828e58a274b01ef4276d96607bf190f8a3
Bug 5278: Log %err_code for "early" request handling errors (#1382)

Certain "early" request handling errors (e.g., ERR_TOO_BIG,
ERR_UNSUP_REQ, ERR_UNSUP_HTTPVERSION, ERR_PROTOCOL_UNKNOWN, and
ERR_INVALID_URL) are handled with nil ClientHttpRequest::request object.
ErrorState relied on that object to record error type and details, so
%err_code expanded to "-" in the corresponding access.log records.

Now, ErrorState also uses ALE (where available). ALE already handles the
combination of an early error and late HttpRequest (e.g., the fake one
clientReplyContext::createStoreEntry() creates when handling the error).

This minimal fix does not address known problems with ErrorState::detail
and ErrorState::BuildHttpReply(). It also duplicates related xerrno
detailing code. We will address some of these problems shortly,
including the increased code duplication problem.
src/errorpage.cc