]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/NoteData.cc
3 #include "acl/Checklist.h"
4 #include "acl/NoteData.h"
5 #include "acl/StringData.h"
7 #include "ConfigParser.h"
9 #include "HttpRequest.h"
13 ACLNoteData::ACLNoteData() : values(new ACLStringData
)
16 ACLNoteData::~ACLNoteData()
22 ACLNoteData::matchNotes(NotePairs
*note
)
27 debugs(28, 3, "Checking " << name
);
30 return (note
->findFirst(name
.termedBuf()) != NULL
);
32 for (Vector
<NotePairs::Entry
*>::iterator i
= note
->entries
.begin(); i
!= note
->entries
.end(); ++i
) {
33 if ((*i
)->name
.cmp(name
.termedBuf()) == 0) {
34 if (values
->match((*i
)->value
.termedBuf()))
42 ACLNoteData::match(HttpRequest
*request
)
44 if (request
->notes
!= NULL
&& matchNotes(request
->notes
.getRaw()))
47 const Adaptation::History::Pointer ah
= request
->adaptLogHistory();
48 if (ah
!= NULL
&& ah
->metaHeaders
!= NULL
&& matchNotes(ah
->metaHeaders
.getRaw()))
58 wordlistAdd(&W
, name
.termedBuf());
59 wordlist
* dumpR
= values
->dump();
60 wordlistAddWl(&W
, dumpR
);
61 wordlistDestroy(&dumpR
);
68 char* t
= strtokFile();
75 ACLNoteData::empty() const
77 return name
.undefined();
80 ACLData
<HttpRequest
*> *
81 ACLNoteData::clone() const
83 ACLNoteData
* result
= new ACLNoteData
;
84 result
->values
= values
->clone();