]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ExternalACLEntry.cc
merge from trunk r12441
[thirdparty/squid.git] / src / ExternalACLEntry.cc
1
2 /*
3 * DEBUG: section 82 External ACL
4 * AUTHOR: Henrik Nordstrom, MARA Systems AB
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
9 * The contents of this file is Copyright (C) 2002 by MARA Systems AB,
10 * Sweden, unless otherwise is indicated in the specific function. The
11 * author gives his full permission to include this file into the Squid
12 * software product under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * Squid is the result of efforts by numerous individuals from
17 * the Internet community; see the CONTRIBUTORS file for full
18 * details. Many organizations have provided support for Squid's
19 * development; see the SPONSORS file for full details. Squid is
20 * Copyrighted (C) 2001 by the Regents of the University of
21 * California; see the COPYRIGHT file for full details. Squid
22 * incorporates software developed and/or copyrighted by other
23 * sources; see the CREDITS file for full details.
24 *
25 * This program is free software; you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License as published by
27 * the Free Software Foundation; either version 2 of the License, or
28 * (at your option) any later version.
29 *
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
34 *
35 * You should have received a copy of the GNU General Public License
36 * along with this program; if not, write to the Free Software
37 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
38 *
39 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
40 */
41
42 #include "squid.h"
43 #include "ExternalACLEntry.h"
44 #include "SquidTime.h"
45
46 /******************************************************************
47 * external_acl cache
48 */
49
50 CBDATA_CLASS_INIT(ExternalACLEntry);
51
52 void *
53 ExternalACLEntry::operator new (size_t byteCount)
54 {
55 /* derived classes with different sizes must implement their own new */
56 assert (byteCount == sizeof (ExternalACLEntry));
57 CBDATA_INIT_TYPE(ExternalACLEntry);
58 return cbdataAlloc(ExternalACLEntry);
59 }
60
61 void
62 ExternalACLEntry::operator delete (void *address)
63 {
64 cbdataFree (address);
65 }
66
67 ExternalACLEntry::ExternalACLEntry()
68 {
69 lru.next = lru.prev = NULL;
70 result = ACCESS_DENIED;
71 date = 0;
72 def = NULL;
73 }
74
75 ExternalACLEntry::~ExternalACLEntry()
76 {
77 safe_free(key);
78 }
79
80 void
81 ExternalACLEntry::update(ExternalACLEntryData const &someData)
82 {
83 date = squid_curtime;
84 result = someData.result;
85 #if USE_AUTH
86 user = someData.user;
87 password = someData.password;
88 #endif
89 message = someData.message;
90 tag = someData.tag;
91 log = someData.log;
92 }