]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Note.cc
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 #include "acl/Checklist.h"
11 #include "acl/HttpHeaderData.h"
13 #include "acl/NoteData.h"
14 #include "HttpRequest.h"
16 #include "parser/Tokenizer.h"
17 #include "sbuf/StringConvert.h"
20 ACLNoteStrategy::match(ACLData
<MatchType
> * &data
, ACLFilledChecklist
*checklist
, ACLFlags
&flags
)
22 if (const auto request
= checklist
->request
) {
23 if (request
->notes
!= NULL
&& matchNotes(data
, request
->notes
.getRaw(), flags
.delimiters()))
26 const Adaptation::History::Pointer ah
= request
->adaptLogHistory();
27 if (ah
!= NULL
&& ah
->metaHeaders
!= NULL
&& matchNotes(data
, ah
->metaHeaders
.getRaw(), flags
.delimiters()))
35 ACLNoteStrategy::matchNotes(ACLData
<MatchType
> *noteData
, const NotePairs
*note
, const CharacterSet
*delimiters
) const
37 for (auto &entry
: note
->entries
) {
39 NotePairs::Entry
e(entry
->name
.termedBuf(), "");
40 Parser::Tokenizer
t(StringToSBuf(entry
->value
));
42 while (t
.token(s
, *delimiters
)) {
44 if (noteData
->match(&e
))
49 if (noteData
->match(&e
))
52 if (noteData
->match(entry
))
59 ACLNoteStrategy::Instance()
64 ACLNoteStrategy
ACLNoteStrategy::Instance_
;