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 
18 
20 {
21  values.clear();
22 }
23 
24 bool
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 
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
51 {
52  while (char *t = ConfigParser::strtokFile()) {
55  values.push_back(m);
56  if (values.back() == Http::METHOD_PURGE)
57  ++ThePurgeCount; // configuration code wants to know
58  }
59 }
60 
~ACLMethodData() override
Definition: MethodData.cc:19
static char * strtokFile()
Definition: ConfigParser.cc:65
std::list< SBuf > SBufList
Definition: forward.h:22
SBufList dump() const override
Definition: MethodData.cc:39
void HttpRequestMethodXXX(char const *)
@ METHOD_PURGE
Definition: MethodType.h:92
void parse() override
Definition: MethodData.cc:50
bool match(HttpRequestMethod) override
Definition: MethodData.cc:25
std::list< HttpRequestMethod > values
Definition: MethodData.h:30
static int ThePurgeCount
PURGE methods seen by parse()
Definition: MethodData.h:32

 

Introduction

Documentation

Support

Miscellaneous