]> git.ipfire.org Git - thirdparty/squid.git/blame - src/StoreMetaVary.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / StoreMetaVary.cc
CommitLineData
528b2c61 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
528b2c61 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
528b2c61 7 */
8
bbc27441
AJ
9/* DEBUG: section 20 Storage Manager Swapfile Metadata */
10
582c2af2 11#include "squid.h"
528b2c61 12#include "MemObject.h"
602d9612
A
13#include "Store.h"
14#include "StoreMetaVary.h"
528b2c61 15
62e76326 16bool
528b2c61 17StoreMetaVary::checkConsistency(StoreEntry *e) const
18{
19 assert (getType() == STORE_META_VARY_HEADERS);
62e76326 20
90ab8f20 21 if (e->mem_obj->vary_headers.isEmpty()) {
62e76326 22 /* XXX separate this mutator from the query */
23 /* Assume the object is OK.. remember the vary request headers */
90ab8f20 24 e->mem_obj->vary_headers.assign(static_cast<const char *>(value), length);
c9974e82
AJ
25 /* entries created before SBuf vary handling may include string terminator */
26 static const SBuf nul("\0", 1);
27 e->mem_obj->vary_headers.trim(nul);
62e76326 28 return true;
528b2c61 29 }
62e76326 30
90ab8f20 31 if (e->mem_obj->vary_headers.cmp(static_cast<const char *>(value), length) != 0)
62e76326 32 return false;
33
528b2c61 34 return true;
35}
f53969cc 36