Squid Web Cache
master
Loading...
Searching...
No Matches
Scheme.cc
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
/* DEBUG: section 29 Authenticator */
10
11
#include "
squid.h
"
12
#include "
auth/Gadgets.h
"
13
#include "
auth/Scheme.h
"
14
#include "
auth/SchemeConfig.h
"
15
#include "
globals.h
"
16
17
void
18
Auth::Scheme::AddScheme
(
Auth::Scheme::Pointer
instance)
19
{
20
iterator
i =
GetSchemes
().begin();
21
22
while
(i !=
GetSchemes
().end()) {
23
assert
(strcmp((*i)->type(), instance->type()) != 0);
24
++i;
25
}
26
27
GetSchemes
().push_back(instance);
28
}
29
30
Auth::Scheme::Pointer
31
Auth::Scheme::Find
(
const
char
*typestr)
32
{
33
for
(
iterator
i = GetSchemes().begin(); i != GetSchemes().end(); ++i) {
34
if
(strcmp((*i)->type(), typestr) == 0)
35
return
*i;
36
}
37
38
return
Auth::Scheme::Pointer
(
nullptr
);
39
}
40
41
std::vector<Auth::Scheme::Pointer> &
42
Auth::Scheme::GetSchemes
()
43
{
44
static
const
auto
schemes =
new
std::vector<Auth::Scheme::Pointer>;
45
return
*schemes;
46
}
47
55
void
56
Auth::Scheme::FreeAll
()
57
{
58
assert
(
shutting_down
);
59
60
while
(GetSchemes().
size
()) {
61
Auth::Scheme::Pointer
scheme = GetSchemes().back();
62
GetSchemes().pop_back();
63
scheme->shutdownCleanup();
64
}
65
}
66
size
int size
Definition
ModDevPoll.cc:70
SchemeConfig.h
Scheme.h
assert
#define assert(EX)
Definition
assert.h:17
Gadgets.h
Auth::Scheme::FreeAll
static void FreeAll()
Definition
Scheme.cc:56
Auth::Scheme::Pointer
RefCount< Scheme > Pointer
Definition
Scheme.h:30
Auth::Scheme::GetSchemes
static std::vector< Scheme::Pointer > & GetSchemes()
Definition
Scheme.cc:42
Auth::Scheme::Find
static Scheme::Pointer Find(const char *)
Definition
Scheme.cc:31
Auth::Scheme::iterator
std::vector< Scheme::Pointer >::iterator iterator
Definition
Scheme.h:31
Auth::Scheme::AddScheme
static void AddScheme(Scheme::Pointer)
Definition
Scheme.cc:18
RefCount
Definition
RefCount.h:28
globals.h
shutting_down
int shutting_down
Definition
testConfigParser.cc:32
squid.h
squid
src
auth
Scheme.cc
Generated by
1.9.8