]> git.ipfire.org Git - thirdparty/squid.git/commit - src/adaptation/icap/ModXact.cc
author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 30 Jan 2017 12:46:15 +0000 (14:46 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 30 Jan 2017 12:46:15 +0000 (14:46 +0200)
commit75d473407acdbf2d79f7a49b4d98083b95b83b9a
tree62ffccb4b4f7df984df9c3594fc4c1d49b5f036c
parentf1afd9a138367bd7a95ca905eda8941cacae9b8d
author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Two new ACLs implemented: annotate_transaction and annotate_client.

Both ACLs always match and are useful for their side effect, immediately
adding a key-value pair to the current transaction annotation
(annotate_transaction) or to the current client-to-Squid connection
annotation (annotate_client).  Connection annotations are propagated to
the current and all future master transactions on the annotated
connection. Before this patch only 'clt_conn_tag' annotation tag could
be used for a connection annotation.

To reuse the existing notes parsing code, I had to refactor Note, Notes
and NotePairs classes:

* Made data members private and adjusted to follow 'rule of three'.
  Having public assess to containers with pointers may cause memory
  problems: for example ExternalACLEntry::update() called directly
  notes.entries.clear() without deleting the pointers.
* None-fatal check for 'special' characters inside note name.
* Used SBufs instead of Strings and const char* where possible.
* Adjusted ACLNoteStrategy::matchNotes() to avoid 'expanding quoted values'
  code duplication inside

Also fixed acl quoted flag parameters syntax. The old code improperly
required quoting both flag and its parameter, e.g., "-m= ," whereas
only parameter should be quoted: -m=" ,".

Also moved UpdateRequestNotes() from Notes.cc to HttpRequest.cc to
resolve dependency problems while bulding unit tests.

TODO: transaction annotation matching code (ACLNoteData) performs
parsing in its own way, using ACLStringData::parse(), lacking special
characters/reserved keywords checks. Consider reusing the existing
Notes parsing code instead.
29 files changed:
src/AccessLogEntry.cc
src/AccessLogEntry.h
src/AclRegs.cc
src/ConfigParser.cc
src/ExternalACLEntry.cc
src/HttpRequest.cc
src/HttpRequest.h
src/Notes.cc
src/Notes.h
src/acl/Acl.cc
src/acl/Acl.h
src/acl/Makefile.am
src/acl/Note.cc
src/acl/NoteData.cc
src/acl/NoteData.h
src/adaptation/Config.cc
src/adaptation/ecap/XactionRep.cc
src/adaptation/icap/ModXact.cc
src/auth/digest/UserRequest.cc
src/auth/negotiate/UserRequest.cc
src/auth/ntlm/UserRequest.cc
src/cf.data.pre
src/client_side.cc
src/client_side.h
src/client_side_request.cc
src/format/Format.cc
src/servers/Http1Server.cc
src/tests/stub_HttpRequest.cc
src/tests/stub_client_side.cc