]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.cc
Supply AccessLogEntry (ALE) for more fast ACL checks. (#182) M-staged-PR182
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Fri, 11 May 2018 08:32:06 +0000 (08:32 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 11 May 2018 22:35:42 +0000 (22:35 +0000)
commitcb365059899d555e825d3f4d749cad8cf1c62482
tree7ae58703b4894831ab434da529c0271e9b9047b0
parent40f1fd09cbaddf589e4e98e3ab28ea4e45b8e84b
Supply AccessLogEntry (ALE) for more fast ACL checks. (#182)

Supplying ALE for fast ACL checks allows those checks to use ACLs that
assemble values from logformat %codes. Today, such ACLs are limited to
misplaced external ACLs (that should not be used with "fast"
directives!), but it is likely that fast ACLs like annotate_client will
eventually require ALE.

The "has" ACL documentation promises ALE for every transaction, but our
code does not deliver on that promise. This change fixes a dozen of
easy cases where ALE was available nearby. Also a non-trivial
cache_peer_access case was fixed, which proved to be more complex
because of the significant call depth of the peerAllowedToUse() check,
which is a known design problem of its own.

More cases need fixing, and the whole concept of ALE probably needs to
be revised because logformat %code expansion is needed in the
increasing number of contexts that have nothing to do with access
logging.

Also fixed triggering of (probably pointless) level-1 warnings:

* ALE missing adapted HttpRequest object
* ALE missing URL

With fix applied, any ACLChecklist with ALE synchronizes it at
'pre-check' stage without logging level-1 warnings. Warnings are
triggered only if for some reason this 'pre-check' synchronization was
bypassed.
29 files changed:
src/FwdState.cc
src/HttpRequest.cc
src/MemObject.h
src/Notes.cc
src/acl/Acl.cc
src/acl/Checklist.h
src/acl/FilledChecklist.cc
src/acl/FilledChecklist.h
src/adaptation/AccessCheck.cc
src/carp.cc
src/carp.h
src/client_side.cc
src/client_side_request.cc
src/comm/TcpAcceptor.cc
src/http.cc
src/icmp/net_db.cc
src/icmp/net_db.h
src/neighbors.cc
src/neighbors.h
src/peer_select.cc
src/peer_sourcehash.cc
src/peer_sourcehash.h
src/peer_userhash.cc
src/peer_userhash.h
src/security/PeerConnector.cc
src/ssl/PeekingPeerConnector.cc
src/tests/stub_carp.cc
src/tests/stub_libicmp.cc
src/tunnel.cc