]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/Scheme.cc
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 29 Authenticator */
12 #include "auth/Gadgets.h"
13 #include "auth/Scheme.h"
14 #include "auth/SchemeConfig.h"
17 std::vector
<Auth::Scheme::Pointer
> *Auth::Scheme::_Schemes
= NULL
;
20 Auth::Scheme::AddScheme(Auth::Scheme::Pointer instance
)
22 iterator i
= GetSchemes().begin();
24 while (i
!= GetSchemes().end()) {
25 assert(strcmp((*i
)->type(), instance
->type()) != 0);
29 GetSchemes().push_back(instance
);
33 Auth::Scheme::Find(const char *typestr
)
35 for (iterator i
= GetSchemes().begin(); i
!= GetSchemes().end(); ++i
) {
36 if (strcmp((*i
)->type(), typestr
) == 0)
40 return Auth::Scheme::Pointer(NULL
);
43 std::vector
<Auth::Scheme::Pointer
> &
44 Auth::Scheme::GetSchemes()
47 _Schemes
= new std::vector
<Auth::Scheme::Pointer
>;
53 * Called when a graceful shutdown is to occur of each scheme module.
54 * On completion the auth components are to be considered deleted.
55 * None will be available globally. Some may remain around for their
56 * currently active connections to close, but only those active
57 * connections will retain pointers to them.
60 Auth::Scheme::FreeAll()
62 assert(shutting_down
);
64 while (GetSchemes().size()) {
65 Auth::Scheme::Pointer scheme
= GetSchemes().back();
66 GetSchemes().pop_back();
67 scheme
->shutdownCleanup();