]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/Scheme.cc
2 * DEBUG: section 29 Authenticator
3 * AUTHOR: Robert Collins
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
31 * Copyright (c) 2004, Robert Collins <robertc@squid-cache.org>
35 #include "auth/Scheme.h"
36 #include "auth/Gadgets.h"
37 #include "auth/Config.h"
40 Vector
<Auth::Scheme::Pointer
> *Auth::Scheme::_Schemes
= NULL
;
43 Auth::Scheme::AddScheme(Auth::Scheme::Pointer instance
)
45 iterator i
= GetSchemes().begin();
47 while (i
!= GetSchemes().end()) {
48 assert(strcmp((*i
)->type(), instance
->type()) != 0);
52 GetSchemes().push_back(instance
);
56 Auth::Scheme::Find(const char *typestr
)
58 for (iterator i
= GetSchemes().begin(); i
!= GetSchemes().end(); ++i
) {
59 if (strcmp((*i
)->type(), typestr
) == 0)
63 return Auth::Scheme::Pointer(NULL
);
66 Vector
<Auth::Scheme::Pointer
> &
67 Auth::Scheme::GetSchemes()
70 _Schemes
= new Vector
<Auth::Scheme::Pointer
>;
76 * Called when a graceful shutdown is to occur of each scheme module.
77 * On completion the auth components are to be considered deleted.
78 * None will be available globally. Some may remain around for their
79 * currently active connections to close, but only those active
80 * connections will retain pointers to them.
83 Auth::Scheme::FreeAll()
85 assert(shutting_down
);
87 while (GetSchemes().size()) {
88 Auth::Scheme::Pointer scheme
= GetSchemes().back();
89 GetSchemes().pop_back();
90 scheme
->shutdownCleanup();