squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
acl
MethodData.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
/* DEBUG: section 28 Access Control */
10
11
#include "
squid.h
"
12
#include "
acl/Checklist.h
"
13
#include "
acl/MethodData.h
"
14
#include "
ConfigParser.h
"
15
#include "
http/RequestMethod.h
"
16
17
int
ACLMethodData::ThePurgeCount
= 0;
18
19
ACLMethodData::~ACLMethodData
()
20
{
21
values
.clear();
22
}
23
24
bool
25
ACLMethodData::match
(
HttpRequestMethod
toFind)
26
{
27
for
(
auto
i =
values
.begin(); i !=
values
.end(); ++i) {
28
if
(*i == toFind) {
29
// tune the list for LRU ordering
30
values
.erase(i);
31
values
.push_front(toFind);
32
return
true
;
33
}
34
}
35
return
false
;
36
}
37
38
SBufList
39
ACLMethodData::dump
()
const
40
{
41
SBufList
sl;
42
for
(std::list<HttpRequestMethod>::const_iterator i =
values
.begin(); i !=
values
.end(); ++i) {
43
sl.push_back((*i).image());
44
}
45
46
return
sl;
47
}
48
49
void
50
ACLMethodData::parse
()
51
{
52
while
(
char
*t =
ConfigParser::strtokFile
()) {
53
HttpRequestMethod
m;
54
m.
HttpRequestMethodXXX
(t);
55
values
.push_back(m);
56
if
(
values
.back() ==
Http::METHOD_PURGE
)
57
++
ThePurgeCount
;
// configuration code wants to know
58
}
59
}
60
Checklist.h
ConfigParser.h
MethodData.h
RequestMethod.h
ACLMethodData::values
std::list< HttpRequestMethod > values
Definition:
MethodData.h:30
ACLMethodData::dump
SBufList dump() const override
Definition:
MethodData.cc:39
ACLMethodData::~ACLMethodData
~ACLMethodData() override
Definition:
MethodData.cc:19
ACLMethodData::ThePurgeCount
static int ThePurgeCount
PURGE methods seen by parse()
Definition:
MethodData.h:32
ACLMethodData::parse
void parse() override
Definition:
MethodData.cc:50
ACLMethodData::match
bool match(HttpRequestMethod) override
Definition:
MethodData.cc:25
ConfigParser::strtokFile
static char * strtokFile()
Definition:
ConfigParser.cc:65
HttpRequestMethod
Definition:
RequestMethod.h:27
HttpRequestMethod::HttpRequestMethodXXX
void HttpRequestMethodXXX(char const *)
Definition:
RequestMethod.cc:31
Http::METHOD_PURGE
@ METHOD_PURGE
Definition:
MethodType.h:92
SBufList
std::list< SBuf > SBufList
Definition:
forward.h:23
squid.h
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Quick Setup
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
il
...
full list
FTP Package Archive