RefreshPattern.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 #ifndef SQUID_REFRESHPATTERN_H_
10 #define SQUID_REFRESHPATTERN_H_
11 
12 #include "base/RegexPattern.h"
13 
16 {
18 
19 public:
20 
21  /*
22  * Defaults:
23  * MIN NONE
24  * PCT 20%
25  * MAX 3 days
26  */
27 #define REFRESH_DEFAULT_MAX static_cast<time_t>(259200)
28 
29  RefreshPattern(const char *aPattern, const decltype(RegexPattern::flags) &reFlags) :
30  pattern(reFlags, aPattern),
31  min(0), pct(0.20), max(REFRESH_DEFAULT_MAX),
32  next(NULL),
33  max_stale(0)
34  {
35  memset(&flags, 0, sizeof(flags));
36  }
37 
39  while (RefreshPattern *t = next) {
40  next = t->next;
41  t->next = nullptr;
42  delete t;
43  }
44  }
45  // ~RefreshPattern() default destructor is fine
46 
48  time_t min;
49  double pct;
50  time_t max;
52 
53  struct {
56 #if USE_HTTP_VIOLATIONS
63 #endif
64  } flags;
65  int max_stale;
66 
67  // statistics about how many matches this pattern has had
68  mutable struct stats_ {
70 
71  uint64_t matchTests;
72  uint64_t matchCount;
73  // TODO: some stats to indicate how useful/less the flags are would be nice.
74  } stats;
75 };
76 
77 #endif /* SQUID_REFRESHPATTERN_H_ */
78 
a representation of a refresh pattern.
RegexPattern pattern
struct RefreshPattern::@95 flags
#define REFRESH_DEFAULT_MAX
RefreshPattern * next
struct RefreshPattern::stats_ stats
RefreshPattern(const char *aPattern, const decltype(RegexPattern::flags)&reFlags)
#define NULL
Definition: types.h:166
MEMPROXY_CLASS(RefreshPattern)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors