StoreMetaVary.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /* DEBUG: section 20 Storage Manager Swapfile Metadata */
10 
11 #include "squid.h"
12 #include "MemObject.h"
13 #include "Store.h"
14 #include "StoreMetaVary.h"
15 
16 bool
18 {
20 
21  if (e->mem_obj->vary_headers.isEmpty()) {
22  /* XXX separate this mutator from the query */
23  /* Assume the object is OK.. remember the vary request headers */
24  e->mem_obj->vary_headers.assign(static_cast<const char *>(value), length);
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);
28  return true;
29  }
30 
31  if (e->mem_obj->vary_headers.cmp(static_cast<const char *>(value), length) != 0)
32  return false;
33 
34  return true;
35 }
36 
#define assert(EX)
Definition: assert.h:17
SBuf & assign(const SBuf &S)
Definition: SBuf.cc:83
Definition: SBuf.h:86
bool isEmpty() const
Definition: SBuf.h:420
void * value
Definition: StoreMeta.h:133
bool checkConsistency(StoreEntry *) const
MemObject * mem_obj
Definition: Store.h:199
int length
Definition: StoreMeta.h:132
SBuf vary_headers
Definition: MemObject.h:174
int cmp(const SBuf &S, const size_type n) const
shorthand version for compare()
Definition: SBuf.h:264
SBuf & trim(const SBuf &toRemove, bool atBeginning=true, bool atEnd=true)
Definition: SBuf.cc:561
char getType() const
Definition: StoreMetaVary.h:19

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors