TransactionInitiator.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/FilledChecklist.h"
14#include "cache_cf.h"
15#include "debug/Stream.h"
16#include "HttpRequest.h"
17#include "MasterXaction.h"
18#include "SquidConfig.h"
19
20Acl::TransactionInitiator::TransactionInitiator (const char *aClass) : class_ (aClass), initiators_(0)
21{}
22
23char const *
25{
26 return class_;
27}
28
29bool
31{
32 return false;
33}
34
35void
37{
38 while (const char *s = ConfigParser::strtokFile()) {
39 initiators_ |= XactionInitiator::ParseInitiators(s);
40 cfgWords.push_back(SBuf(s));
41 }
42}
43
44int
46{
47 ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist);
48 assert(filled->request);
50 const XactionInitiator requestInitiator = filled->request->masterXaction->initiator;
51 return requestInitiator.in(initiators_) ? 1 : 0;
52}
53
56{
57 return cfgWords;
58}
59
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
#define assert(EX)
Definition: assert.h:17
HttpRequest::Pointer request
int match(ACLChecklist *checklist) override
Matches the actual data in checklist against this ACL.
SBufList dump() const override
bool empty() const override
char const * typeString() const override
void parse() override
parses node representation in squid.conf; dies on failures
static char * strtokFile()
Definition: ConfigParser.cc:65
MasterXaction::Pointer masterXaction
the master transaction this request belongs to. Never nil.
Definition: HttpRequest.h:238
XactionInitiator initiator
the initiator of this transaction
Definition: MasterXaction.h:69
Definition: SBuf.h:94
identifies a protocol agent or Squid feature initiating transactions
static Initiators ParseInitiators(const char *name)
bool in(Initiators setOfInitiators) const
whether this initiator belongs to the given set
std::list< SBuf > SBufList
Definition: forward.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors