From: Francesco Chemolli Date: Tue, 4 Sep 2012 11:58:36 +0000 (+0200) Subject: Moved HttpHeaderFieldStat to own header file. X-Git-Tag: sourceformat-review-1~6^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db2de30ae1911f76c6a5bd761fced681338e0149;p=thirdparty%2Fsquid.git Moved HttpHeaderFieldStat to own header file. --- diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index f9d71a702c..eb48996da9 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -33,6 +33,7 @@ #include "squid.h" #include "base/StringArea.h" #include "HttpHeader.h" +#include "HttpHeaderFieldStat.h" #include "HttpHeaderStat.h" #include "HttpHeaderTools.h" #include "HttpHdrCc.h" diff --git a/src/HttpHdrSc.cc b/src/HttpHdrSc.cc index ca32ef9801..40b64b0613 100644 --- a/src/HttpHdrSc.cc +++ b/src/HttpHdrSc.cc @@ -37,6 +37,7 @@ #include "squid.h" #include "HttpHdrSc.h" #include "HttpHeader.h" +#include "HttpHeaderFieldStat.h" #include "HttpHeaderStat.h" #include "HttpHeaderTools.h" #include "Store.h" diff --git a/src/HttpHeaderFieldStat.h b/src/HttpHeaderFieldStat.h new file mode 100644 index 0000000000..2753f23ba6 --- /dev/null +++ b/src/HttpHeaderFieldStat.h @@ -0,0 +1,51 @@ +#ifndef SQUID_HTTPHEADERFIELDSTAT_H_ +#define SQUID_HTTPHEADERFIELDSTAT_H_ +/* + * DEBUG: section + * AUTHOR: + * + * 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. + * + */ + +/// per field statistics +class HttpHeaderFieldStat +{ +public: + HttpHeaderFieldStat() : aliveCount(0), seenCount(0), parsCount(0), errCount(0), repCount(0) {} + + int aliveCount; /* created but not destroyed (count) */ + int seenCount; /* #fields we've seen */ + int parsCount; /* #parsing attempts */ + int errCount; /* #pasring errors */ + int repCount; /* #repetitons */ +}; + + + + +#endif /* SQUID_HTTPHEADERFIELDSTAT_H_ */ diff --git a/src/Makefile.am b/src/Makefile.am index 35e7aa126d..c9493a38a1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -364,6 +364,7 @@ squid_SOURCES = \ HttpStatusCode.h \ HttpStatusLine.cc \ HttpStatusLine.h \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -1108,6 +1109,7 @@ tests_testHttpReply_SOURCES=\ ETag.cc \ HttpBody.h \ HttpBody.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -1214,6 +1216,7 @@ tests_testACLMaxUserIP_SOURCES= \ HttpHeaderTools.cc \ HttpHdrContRange.cc \ HttpHdrRange.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -1428,6 +1431,7 @@ tests_testCacheManager_SOURCES = \ HttpHeader.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -1599,6 +1603,7 @@ tests_testDiskIO_SOURCES = \ filemap.cc \ HttpBody.h \ HttpBody.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -1817,6 +1822,7 @@ tests_testEvent_SOURCES = \ HttpHeader.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -2051,6 +2057,7 @@ tests_testEventLoop_SOURCES = \ HttpHeader.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -2278,6 +2285,7 @@ tests_test_http_range_SOURCES = \ http.cc \ HttpBody.h \ HttpBody.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -2562,6 +2570,7 @@ tests_testHttpRequest_SOURCES = \ HttpHeader.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -2728,6 +2737,7 @@ tests_testStore_SOURCES= \ EventLoop.cc \ FileMap.h \ filemap.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -3020,6 +3030,7 @@ tests_testUfs_SOURCES = \ MemBuf.cc \ HttpHdrContRange.cc \ Packer.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -3109,6 +3120,7 @@ tests_testRock_SOURCES = \ fd.cc \ FileMap.h \ filemap.cc \ + HttpHeaderFieldStat.h \ HttpBody.h \ HttpBody.cc \ HttpHdrCc.cc \ @@ -3329,6 +3341,7 @@ tests_testCoss_SOURCES = \ MemBuf.cc \ HttpHdrContRange.cc \ Packer.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -3483,6 +3496,7 @@ tests_testNull_SOURCES = \ MemBuf.cc \ HttpHdrContRange.cc \ Packer.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ @@ -3609,6 +3623,7 @@ tests_testURL_SOURCES = \ http.cc \ HttpBody.h \ HttpBody.cc \ + HttpHeaderFieldStat.h \ HttpHdrCc.h \ HttpHdrCc.cc \ HttpHdrCc.cci \ diff --git a/src/structs.h b/src/structs.h index 0518bb68d7..fda5cd2749 100644 --- a/src/structs.h +++ b/src/structs.h @@ -182,21 +182,6 @@ struct _fde_disk { off_t offset; }; -/* per field statistics */ - -class HttpHeaderFieldStat -{ - -public: - HttpHeaderFieldStat() : aliveCount(0), seenCount(0), parsCount(0), errCount(0), repCount(0) {} - - int aliveCount; /* created but not destroyed (count) */ - int seenCount; /* #fields we've seen */ - int parsCount; /* #parsing attempts */ - int errCount; /* #pasring errors */ - int repCount; /* #repetitons */ -}; - /* compiled version of HttpHeaderFieldAttrs plus stats */ #include "SquidString.h"