Squid Web Cache
master
Loading...
Searching...
No Matches
ReplyHeaderStrategy.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 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
#ifndef SQUID_SRC_ACL_REPLYHEADERSTRATEGY_H
10
#define SQUID_SRC_ACL_REPLYHEADERSTRATEGY_H
11
12
#include "
acl/Data.h
"
13
#include "
acl/FilledChecklist.h
"
14
#include "
acl/ParameterizedNode.h
"
15
#include "
acl/ReplyHeaderStrategy.h
"
16
#include "
HttpReply.h
"
17
18
namespace
Acl
19
{
20
22
template
<Http::HdrType header>
23
class
ReplyHeaderCheck
:
public
ParameterizedNode
< ACLData<const char *> >
24
{
25
public
:
26
/* Acl::Node API */
27
int
match
(
ACLChecklist
*)
override
;
28
bool
requiresReply
()
const override
{
return
true
;}
29
};
30
31
}
// namespace Acl
32
33
template
<Http::HdrType header>
34
int
35
Acl::ReplyHeaderCheck<header>::match
(
ACLChecklist
*
const
ch)
36
{
37
const
auto
checklist =
Filled
(ch);
38
39
const
auto
theHeader = checklist->reply().header.getStr(header);
40
41
if
(
nullptr
== theHeader)
42
return
0;
43
44
return
data->match(theHeader);
45
}
46
47
#endif
/* SQUID_SRC_ACL_REPLYHEADERSTRATEGY_H */
48
Data.h
FilledChecklist.h
Filled
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
Definition
FilledChecklist.h:146
HttpReply.h
ParameterizedNode.h
ReplyHeaderStrategy.h
ACLChecklist
Definition
Checklist.h:31
Acl::ParameterizedNode
Definition
ParameterizedNode.h:24
Acl::ReplyHeaderCheck
matches the value of a given reply header (e.g., "rep_mime_type" ACL)
Definition
ReplyHeaderStrategy.h:24
Acl::ReplyHeaderCheck::match
int match(ACLChecklist *) override
Matches the actual data in checklist against this Acl::Node.
Definition
ReplyHeaderStrategy.h:35
Acl::ReplyHeaderCheck::requiresReply
bool requiresReply() const override
whether our (i.e. shallow) match() requires checklist to have a reply
Definition
ReplyHeaderStrategy.h:28
Acl
Definition
Acl.cc:33
squid
src
acl
ReplyHeaderStrategy.h
Generated by
1.9.8