25 debugs(20, 3,
"ignoring swap meta field with a reserved type: " <<
int(type));
30 debugs(20,
DBG_IMPORTANT,
"ERROR: Ignoring swap meta field with a deprecated type: " <<
int(type));
39 const auto typeValuesWeMightAdd = 10;
41 if (type >= typeValuesWeMightAdd && type - typeValuesWeMightAdd >
RawSwapMetaTypeTop()) {
42 debugs(20,
DBG_IMPORTANT,
"ERROR: Malformed cache storage; ignoring swap meta field with an unexpected type: " <<
int(type));
47 debugs(20, 3,
"ignoring swap meta field with a presumed future type: " <<
int(type));
52 debugs(20,
DBG_IMPORTANT,
"ERROR: Malformed cache storage; ignoring swap meta field with an invalid type: " <<
int(type));
59 auto input =
static_cast<const char *
>(begin);
69 if (lengthOrGarbage < 0)
73 if (input + lengthOrGarbage > end)
75 rawLength =
static_cast<size_t>(lengthOrGarbage);
85 if (rawLength != expectedLength)
87 expectedLength,
"-byte value: ", *
this),
Here());
95 const auto rawValue =
reinterpret_cast<const char*
>(meta.
rawValue);
#define Here()
source code location of the caller
Raw & minLevel(const int aLevel)
limit data printing to at least the given debugging level
Raw & hex()
print data using two hex digits per byte (decoder: xxd -r -p)
an std::runtime_error with thrower location info
#define debugs(SECTION, LEVEL, CONTENT)
const RawSwapMetaType RawSwapMetaTypeBottom
const size_t SwapMetaFieldValueLengthMax
static void HandleBadRawType(const RawSwapMetaType type)
properly reports or rejects a problematic raw swap meta field type
void SwapMetaExtract(Item &item, const char *&input, const void *end)
constexpr RawSwapMetaType RawSwapMetaTypeTop()
constexpr bool HonoredSwapMetaType(const RawSwapMetaType type)
constexpr bool ReservedSwapMetaType(const RawSwapMetaType type)
std::ostream & operator<<(std::ostream &os, const ParsingBuffer &b)
constexpr bool DeprecatedSwapMetaType(const RawSwapMetaType type)
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf