From: Francesco Chemolli Date: Wed, 5 Sep 2012 13:45:53 +0000 (+0200) Subject: Renamed acl_name_list to AclNameList and moved ot own header file in acl/ X-Git-Tag: sourceformat-review-1~6^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6be705457967779a9905c501f866102d458c7f3c;p=thirdparty%2Fsquid.git Renamed acl_name_list to AclNameList and moved ot own header file in acl/ --- diff --git a/src/acl/AclNameList.h b/src/acl/AclNameList.h new file mode 100644 index 0000000000..c60120dfcb --- /dev/null +++ b/src/acl/AclNameList.h @@ -0,0 +1,40 @@ +#ifndef SQUID_ACL_ACLNAMELIST_H_ +#define SQUID_ACL_ACLNAMELIST_H_ +/* + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "defines.h" +//TODO: convert to a std::list +class AclNameList { +public: + char name[ACL_NAME_SZ]; + AclNameList *next; +}; + +#endif /* SQUID_ACLNAMELIST_H_ */ diff --git a/src/acl/Gadgets.cc b/src/acl/Gadgets.cc index d65f6e8abd..b06363ca84 100644 --- a/src/acl/Gadgets.cc +++ b/src/acl/Gadgets.cc @@ -38,6 +38,7 @@ #include "squid.h" #include "acl/Acl.h" +#include "acl/AclNameList.h" #include "acl/Checklist.h" #include "acl/Strategised.h" #include "acl/Gadgets.h" @@ -56,7 +57,7 @@ aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_al debugs(28, 8, HERE << "got called for " << name); for (A = *head; A; A = A->next) { - acl_name_list *L = NULL; + AclNameList *L = NULL; if (!redirect_allowed && strchr(A->err_page_name, ':') ) { debugs(28, 8, HERE << "Skip '" << A->err_page_name << "' 30x redirects not allowed as response here."); @@ -112,8 +113,8 @@ aclParseDenyInfoLine(acl_deny_info_list ** head) acl_deny_info_list *A = NULL; acl_deny_info_list *B = NULL; acl_deny_info_list **T = NULL; - acl_name_list *L = NULL; - acl_name_list **Tail = NULL; + AclNameList *L = NULL; + AclNameList **Tail = NULL; /* first expect a page name */ @@ -131,7 +132,7 @@ aclParseDenyInfoLine(acl_deny_info_list ** head) Tail = &A->acl_list; while ((t = strtok(NULL, w_space))) { - L = (acl_name_list *)memAllocate(MEM_ACL_NAME_LIST); + L = (AclNameList *)memAllocate(MEM_ACL_NAME_LIST); xstrncpy(L->name, t, ACL_NAME_SZ); *Tail = L; Tail = &L->next; @@ -287,8 +288,8 @@ aclDestroyDenyInfoList(acl_deny_info_list ** list) { acl_deny_info_list *a = NULL; acl_deny_info_list *a_next = NULL; - acl_name_list *l = NULL; - acl_name_list *l_next = NULL; + AclNameList *l = NULL; + AclNameList *l_next = NULL; debugs(28, 8, "aclDestroyDenyInfoList: invoked"); diff --git a/src/acl/Makefile.am b/src/acl/Makefile.am index 112230036b..580eed0b7c 100644 --- a/src/acl/Makefile.am +++ b/src/acl/Makefile.am @@ -105,6 +105,7 @@ libacls_la_SOURCES = \ UserData.cc \ UserData.h \ \ + AclNameList.h \ Gadgets.cc \ Gadgets.h diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 60fd38f849..9078686fe1 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -32,6 +32,7 @@ #include "squid.h" #include "acl/Acl.h" +#include "acl/AclNameList.h" #include "acl/Gadgets.h" #include "acl/MethodData.h" #include "anyp/PortCfg.h" @@ -2437,7 +2438,7 @@ free_cachemgrpasswd(cachemgr_passwd ** head) static void dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var) { - acl_name_list *a; + AclNameList *a; while (var != NULL) { storeAppendPrintf(entry, "%s %s", name, var->err_page_name); @@ -2462,8 +2463,8 @@ free_denyinfo(acl_deny_info_list ** list) { acl_deny_info_list *a = NULL; acl_deny_info_list *a_next = NULL; - acl_name_list *l = NULL; - acl_name_list *l_next = NULL; + AclNameList *l = NULL; + AclNameList *l_next = NULL; for (a = *list; a; a = a_next) { for (l = a->acl_list; l; l = l_next) { diff --git a/src/mem.cc b/src/mem.cc index 6cd3cad16b..dec2049092 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -31,10 +31,11 @@ */ #include "squid.h" -#include "event.h" +#include "acl/AclNameList.h" #include "ClientInfo.h" -#include "Mem.h" +#include "event.h" #include "md5.h" +#include "Mem.h" #include "MemBuf.h" #include "memMeter.h" #include "mgr/Registration.h" @@ -451,7 +452,7 @@ Mem::Init(void) memDataInit(MEM_64K_BUF, "64K Buffer", 65536, 10, false); memDataInit(MEM_ACL_DENY_INFO_LIST, "acl_deny_info_list", sizeof(acl_deny_info_list), 0); - memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(acl_name_list), 0); + memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(AclNameList), 0); #if USE_CACHE_DIGESTS memDataInit(MEM_CACHE_DIGEST, "CacheDigest", sizeof(CacheDigest), 0); diff --git a/src/structs.h b/src/structs.h index 375ac0791f..3b4b1dd103 100644 --- a/src/structs.h +++ b/src/structs.h @@ -29,13 +29,14 @@ #ifndef SQUID_STRUCTS_H #define SQUID_STRUCTS_H -#include "RefCount.h" +#include "acl/AclNameList.h" #include "cbdata.h" #include "defines.h" #include "dlink.h" #include "err_type.h" #include "hash.h" #include "ip/Address.h" +#include "RefCount.h" /* needed for the global config */ #include "HttpHeader.h" @@ -46,15 +47,10 @@ #define PEER_MULTICAST_SIBLINGS 1 -struct acl_name_list { - char name[ACL_NAME_SZ]; - acl_name_list *next; -}; - struct acl_deny_info_list { err_type err_page_id; char *err_page_name; - acl_name_list *acl_list; + AclNameList *acl_list; acl_deny_info_list *next; };