On 2017-01-06 04:34, Alex Rousskov wrote:
On 01/05/2017 06:22 AM, Amos Jeffries wrote:
This patch removes HttpHdrCc.cci file, moving the simple methods
inline
to the HttpHdrCc.h and more complicated setter to HttpHdrCc.cc.
You forgot to attach the patch.
Alex.
Dang webmailer. Should be attached now.
Amos
=== modified file 'src/HttpHdrCc.cc'
--- src/HttpHdrCc.cc 2017-01-01 00:12:22 +0000
+++ src/HttpHdrCc.cc 2017-01-05 03:32:44 +0000
@@ -71,6 +71,25 @@
*this=HttpHdrCc();
}
+/// set a data member to a new value, and set the corresponding mask-bit.
+/// if setting is false, then the mask-bit is cleared.
+void
+HttpHdrCc::setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting)
+{
+ if (setting) {
+ if (new_value < 0) {
+ debugs(65, 3, "rejecting negative-value Cache-Control directive " << hdr
+ << " value " << new_value);
+ return;
+ }
+ } else {
+ new_value = -1; //rely on the convention that "unknown" is -1
+ }
+
+ value = new_value;
+ setMask(hdr,setting);
+}
+
bool
HttpHdrCc::parse(const String & str)
{
@@ -331,7 +350,3 @@
return s;
}
-#if !_USE_INLINE_
-#include "HttpHdrCc.cci"
-#endif
-
=== removed file 'src/HttpHdrCc.cci'
--- src/HttpHdrCc.cci 2017-01-01 00:12:22 +0000
+++ src/HttpHdrCc.cci 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 65 HTTP Cache Control Header */
-
-#include "Debug.h"
-#include "defines.h"
-
-bool
-HttpHdrCc::isSet(HttpHdrCcType id) const
-{
- assert(id < HttpHdrCcType::CC_ENUM_END);
- return EBIT_TEST(mask, static_cast<long>(id));
-}
-
-void
-HttpHdrCc::setMask(HttpHdrCcType id, bool newval)
-{
- if (newval)
- EBIT_SET(mask,static_cast<long>(id));
- else
- EBIT_CLR(mask, static_cast<long>(id));
-}
-
-/// set a data member to a new value, and set the corresponding mask-bit.
-/// if setting is false, then the mask-bit is cleared.
-void
-HttpHdrCc::setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting)
-{
- if (setting) {
- if (new_value < 0) {
- debugs(65,3,HERE << "rejecting negative-value Cache-Control directive " << hdr
- << " value " << new_value );
- return;
- }
- } else {
- new_value=-1; //rely on the convention that "unknown" is -1
- }
-
- value=new_value;
- setMask(hdr,setting);
-}
-
=== modified file 'src/HttpHdrCc.h'
--- src/HttpHdrCc.h 2017-01-01 00:12:22 +0000
+++ src/HttpHdrCc.h 2017-01-05 04:09:03 +0000
@@ -9,6 +9,7 @@
#ifndef SQUID_HTTPHDRCC_H
#define SQUID_HTTPHDRCC_H
+#include "defines.h"
#include "dlink.h"
#include "mem/forward.h"
#include "SquidString.h"
@@ -167,7 +168,10 @@
void clearImmutable() {setMask(HttpHdrCcType::CC_IMMUTABLE,false);}
/// check whether the attribute value supplied by id is set
- _SQUID_INLINE_ bool isSet(HttpHdrCcType id) const;
+ bool isSet(HttpHdrCcType id) const {
+ assert(id < HttpHdrCcType::CC_ENUM_END);
+ return EBIT_TEST(mask, static_cast<long>(id));
+ }
void packInto(Packable * p) const;
@@ -187,8 +191,14 @@
String no_cache; ///< List of headers sent as value for CC:no-cache="...". May be empty/undefined if the value is missing.
/// low-level part of the public set method, performs no checks
- _SQUID_INLINE_ void setMask(HttpHdrCcType id, bool newval=true);
- _SQUID_INLINE_ void setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true);
+ void setMask(HttpHdrCcType id, bool newval=true) {
+ if (newval)
+ EBIT_SET(mask,static_cast<long>(id));
+ else
+ EBIT_CLR(mask, static_cast<long>(id));
+ }
+
+ void setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true);
public:
/**comma-separated representation of the header values which were
@@ -204,12 +214,7 @@
void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
-std::ostream&
-operator<< (std::ostream &, HttpHdrCcType);
-
-#if _USE_INLINE_
-#include "HttpHdrCc.cci"
-#endif
+std::ostream & operator<< (std::ostream &, HttpHdrCcType);
#endif /* SQUID_HTTPHDRCC_H */
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2017-01-03 13:27:40 +0000
+++ src/Makefile.am 2017-01-05 03:32:12 +0000
@@ -317,7 +317,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrRange.cc \
HttpHdrSc.cc \
HttpHdrSc.h \
@@ -932,7 +931,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrContRange.h \
HttpHdrRange.cc \
@@ -1047,7 +1045,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
HttpMsg.cc \
@@ -1274,7 +1271,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -1458,7 +1454,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
@@ -1694,7 +1689,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -1931,7 +1925,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -2158,7 +2151,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -2479,7 +2471,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -2709,7 +2700,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
@@ -3004,7 +2994,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
url.cc \
@@ -3317,7 +3306,6 @@
HttpHeaderFieldStat.h \
HttpHdrCc.h \
HttpHdrCc.cc \
- HttpHdrCc.cci \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev