From 79cb238d32f20b19d9956b991a5b7ee98f645907 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Tue, 4 Sep 2012 15:09:04 +0200 Subject: [PATCH] Moved HttpHeaderFieldInfo to own header file. --- src/HttpHdrSc.cc | 2 ++ src/HttpHeader.cc | 2 ++ src/HttpHeaderFieldInfo.h | 49 ++++++++++++++++++++++++++++++++++ src/HttpHeaderTools.cc | 1 + src/HttpHeaderTools.h | 2 +- src/Makefile.am | 15 +++++++++++ src/auth/digest/auth_digest.cc | 1 + src/structs.h | 14 ---------- 8 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 src/HttpHeaderFieldInfo.h diff --git a/src/HttpHdrSc.cc b/src/HttpHdrSc.cc index 40b64b0613..ccc8f9260c 100644 --- a/src/HttpHdrSc.cc +++ b/src/HttpHdrSc.cc @@ -37,6 +37,7 @@ #include "squid.h" #include "HttpHdrSc.h" #include "HttpHeader.h" +#include "HttpHeaderFieldInfo.h" #include "HttpHeaderFieldStat.h" #include "HttpHeaderStat.h" #include "HttpHeaderTools.h" @@ -65,6 +66,7 @@ static const HttpHeaderFieldAttrs ScAttrs[SC_ENUM_END] = { {"Other,", (http_hdr_type)SC_OTHER} /* ',' will protect from matches */ }; +class HttpHeaderFieldInfo; HttpHeaderFieldInfo *ScFieldsInfo = NULL; http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader) diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 2129169539..b2f899aad6 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -36,6 +36,7 @@ #include "HttpHdrContRange.h" #include "HttpHdrSc.h" #include "HttpHeader.h" +#include "HttpHeaderFieldInfo.h" #include "HttpHeaderStat.h" #include "HttpHeaderTools.h" #include "MemBuf.h" @@ -162,6 +163,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = { {"Other:", HDR_OTHER, ftStr} /* ':' will not allow matches */ }; +class HttpHeaderFieldInfo; static HttpHeaderFieldInfo *Headers = NULL; http_hdr_type &operator++ (http_hdr_type &aHeader) diff --git a/src/HttpHeaderFieldInfo.h b/src/HttpHeaderFieldInfo.h new file mode 100644 index 0000000000..8af6608745 --- /dev/null +++ b/src/HttpHeaderFieldInfo.h @@ -0,0 +1,49 @@ +#ifndef SQUID_HTTPHEADERFIELDINFO_H_ +#define SQUID_HTTPHEADERFIELDINFO_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 "SquidString.h" +#include "HttpHeaderFieldStat.h" + +/* compiled version of HttpHeaderFieldAttrs plus stats */ +class HttpHeaderFieldInfo +{ +public: + HttpHeaderFieldInfo() : id (HDR_ACCEPT), type (ftInvalid) {} + + http_hdr_type id; + String name; + field_type type; + HttpHeaderFieldStat stat; +}; + + + +#endif /* SQUID_HTTPHEADERFIELDINFO_H_ */ diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 5f12ab21cc..aea3577f6e 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -40,6 +40,7 @@ #include "fde.h" #include "HttpHdrContRange.h" #include "HttpHeader.h" +#include "HttpHeaderFieldInfo.h" #include "HttpHeaderTools.h" #include "HttpRequest.h" #include "MemBuf.h" diff --git a/src/HttpHeaderTools.h b/src/HttpHeaderTools.h index b79b257199..738023ad83 100644 --- a/src/HttpHeaderTools.h +++ b/src/HttpHeaderTools.h @@ -94,10 +94,10 @@ public: extern int httpHeaderParseOffset(const char *start, int64_t * off); -class HttpHeaderFieldInfo; class String; class HttpHeader; class HttpRequest; +class HttpHeaderFieldInfo; extern HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count); extern void httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * info, int count); diff --git a/src/Makefile.am b/src/Makefile.am index c9493a38a1..b1f57427df 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -380,6 +380,7 @@ squid_SOURCES = \ HttpHeader.cc \ HttpHeaderMask.h \ HttpHeaderRange.h \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpBody.h \ @@ -1123,6 +1124,7 @@ tests_testHttpReply_SOURCES=\ HttpHeader.h \ HttpHeader.cc \ HttpHeaderMask.h \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpControlMsg.h \ @@ -1212,6 +1214,7 @@ tests_testACLMaxUserIP_SOURCES= \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHdrContRange.cc \ @@ -1429,6 +1432,7 @@ tests_testCacheManager_SOURCES = \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeaderFieldStat.h \ @@ -1611,6 +1615,7 @@ tests_testDiskIO_SOURCES = \ HttpHdrSc.cc \ HttpHdrScTarget.cc \ HttpHdrRange.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeader.h \ @@ -1820,6 +1825,7 @@ tests_testEvent_SOURCES = \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeaderFieldStat.h \ @@ -2055,6 +2061,7 @@ tests_testEventLoop_SOURCES = \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeaderFieldStat.h \ @@ -2295,6 +2302,7 @@ tests_test_http_range_SOURCES = \ HttpHdrScTarget.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpMsg.cc \ @@ -2568,6 +2576,7 @@ tests_testHttpRequest_SOURCES = \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeaderFieldStat.h \ @@ -2745,6 +2754,7 @@ tests_testStore_SOURCES= \ HttpHdrRange.cc \ HttpHdrSc.cc \ HttpHdrScTarget.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeader.h \ @@ -3020,6 +3030,7 @@ tests_testUfs_SOURCES = \ stmem.cc \ mime.h \ tests/stub_mime.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeader.h \ @@ -3130,6 +3141,7 @@ tests_testRock_SOURCES = \ HttpHdrScTarget.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpMsg.cc \ @@ -3331,6 +3343,7 @@ tests_testCoss_SOURCES = \ stmem.cc \ mime.h \ tests/stub_mime.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeader.h \ @@ -3486,6 +3499,7 @@ tests_testNull_SOURCES = \ stmem.cc \ mime.h \ tests/stub_mime.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpHeader.h \ @@ -3633,6 +3647,7 @@ tests_testURL_SOURCES = \ HttpHdrScTarget.cc \ HttpHeader.h \ HttpHeader.cc \ + HttpHeaderFieldInfo.h \ HttpHeaderTools.h \ HttpHeaderTools.cc \ HttpMsg.cc \ diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 125848b9ae..608fbcd5d5 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -91,6 +91,7 @@ static const HttpHeaderFieldAttrs DigestAttrs[DIGEST_ENUM_END] = { {"response", (http_hdr_type)DIGEST_RESPONSE}, }; +class HttpHeaderFieldInfo; static HttpHeaderFieldInfo *DigestFieldsInfo = NULL; /* diff --git a/src/structs.h b/src/structs.h index fda5cd2749..b4be3908a5 100644 --- a/src/structs.h +++ b/src/structs.h @@ -182,20 +182,6 @@ struct _fde_disk { off_t offset; }; -/* compiled version of HttpHeaderFieldAttrs plus stats */ -#include "SquidString.h" - -class HttpHeaderFieldInfo -{ - -public: - HttpHeaderFieldInfo() : id (HDR_ACCEPT), type (ftInvalid) {} - - http_hdr_type id; - String name; - field_type type; - HttpHeaderFieldStat stat; -}; class http_state_flags { public: -- 2.47.2