]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/ConnectionsEncrypted.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / acl / ConnectionsEncrypted.cc
CommitLineData
652789d8 1/*
5b74111a 2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
652789d8
CT
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"
652789d8 12#include "acl/ConnectionsEncrypted.h"
ff89bfa0 13#include "acl/FilledChecklist.h"
652789d8 14#include "Debug.h"
652789d8 15#include "HttpReply.h"
ff89bfa0 16#include "HttpRequest.h"
652789d8
CT
17#include "SquidConfig.h"
18
19ACL *
20Acl::ConnectionsEncrypted::clone() const
21{
22 return new Acl::ConnectionsEncrypted(*this);
23}
24
25Acl::ConnectionsEncrypted::ConnectionsEncrypted (char const *theClass) : class_ (theClass)
26{}
27
28Acl::ConnectionsEncrypted::ConnectionsEncrypted (Acl::ConnectionsEncrypted const & old) :class_ (old.class_)
29{}
30
31Acl::ConnectionsEncrypted::~ConnectionsEncrypted()
32{}
33
34char const *
35Acl::ConnectionsEncrypted::typeString() const
36{
37 return class_;
38}
39
40bool
41Acl::ConnectionsEncrypted::empty () const
42{
43 return false;
44}
45
46void
47Acl::ConnectionsEncrypted::parse()
48{
49 if (ConfigParser::strtokFile()) {
50 debugs(89, DBG_CRITICAL, "WARNING: connections_encrypted does not accepts any value.");
51 }
52}
53
54int
55Acl::ConnectionsEncrypted::match(ACLChecklist *checklist)
56{
57 if (!checklist->hasRequest()) {
58 debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in " <<
59 "context without an HTTP request. Assuming mismatch.");
60 return 0;
61 }
62
63 ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist);
ff89bfa0 64
652789d8 65 const bool safeRequest =
63df1d28 66 !(filled->request->sources & Http::Message::srcUnsafe);
652789d8 67 const bool safeReply = !filled->reply ||
63df1d28 68 !(filled->reply->sources & Http::Message::srcUnsafe);
652789d8
CT
69
70 return (safeRequest && safeReply) ? 1 : 0;
71}
72
73SBufList
74Acl::ConnectionsEncrypted::dump() const
75{
76 return SBufList();
77}
78