ConnectionsEncrypted.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"
13 #include "acl/FilledChecklist.h"
14 #include "debug/Stream.h"
15 #include "HttpReply.h"
16 #include "HttpRequest.h"
17 #include "SquidConfig.h"
18 
19 Acl::ConnectionsEncrypted::ConnectionsEncrypted (char const *theClass) : class_ (theClass)
20 {}
21 
23 {}
24 
25 char const *
27 {
28  return class_;
29 }
30 
31 bool
33 {
34  return false;
35 }
36 
37 void
39 {
41  debugs(89, DBG_CRITICAL, "WARNING: connections_encrypted does not accept any value.");
42  }
43 }
44 
45 int
47 {
48  if (!checklist->hasRequest()) {
49  debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in " <<
50  "context without an HTTP request. Assuming mismatch.");
51  return 0;
52  }
53 
54  ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist);
55 
56  const bool safeRequest =
58  const bool safeReply = !filled->hasReply() ||
59  !(filled->reply().sources & Http::Message::srcUnsafe);
60 
61  return (safeRequest && safeReply) ? 1 : 0;
62 }
63 
66 {
67  return SBufList();
68 }
69 
#define DBG_CRITICAL
Definition: Stream.h:37
static char * strtokFile()
Definition: ConfigParser.cc:65
std::list< SBuf > SBufList
Definition: forward.h:22
const HttpReply & reply() const
void parse() override
parses node representation in squid.conf; dies on failures
SBufList dump() const override
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
HttpRequest::Pointer request
virtual bool hasRequest() const =0
bool empty() const override
uint32_t sources
The message sources.
Definition: Message.h:99
bool hasReply() const override
@ srcUnsafe
Unsafe sources mask.
Definition: Message.h:44
#define DBG_IMPORTANT
Definition: Stream.h:38
const char * typeString() const override
int match(ACLChecklist *checklist) override
Matches the actual data in checklist against this Acl::Node.
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:192

 

Introduction

Documentation

Support

Miscellaneous