DelayPool.cc
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 /* DEBUG: section 77 Delay Pools */
10 
11 #include "squid.h"
12 
13 #if USE_DELAY_POOLS
14 #include "acl/Acl.h"
15 #include "acl/Gadgets.h"
16 #include "CommonPool.h"
17 #include "DelayPool.h"
18 #include "Store.h"
19 
20 DelayPool::DelayPool() : pool (NULL), access (NULL)
21 {
23 }
24 
26 {
27  if (pool)
28  freeData();
29 
30  if (access)
32 }
33 
34 void
36 {
37  assert(theComposite() != NULL);
38  theComposite()->parse();
39 }
40 
41 void
42 DelayPool::dump(StoreEntry *entry, unsigned int i) const
43 {
44  if (theComposite() == NULL)
45  return;
46 
47  storeAppendPrintf(entry, "delay_class %d %s\n", i + 1, pool->theClassTypeLabel());
48 
49  LOCAL_ARRAY(char, nom, 32);
50 
51  snprintf(nom, 32, "delay_access %d", i + 1);
52 
53  dump_acl_access(entry, nom, access);
54 
55  storeAppendPrintf(entry, "delay_parameters %d", i + 1);
56 
57  theComposite()->dump (entry);
58 
59  storeAppendPrintf(entry, "\n");
60 }
61 
62 void
63 DelayPool::createPool(u_char delay_class)
64 {
65  if (pool)
66  freeData();
67 
68  pool = CommonPool::Factory(delay_class, theComposite_);
69 }
70 
71 void
73 {
74  delete pool;
75  pool = NULL;
76 }
77 
79 void
81 {
82  deferredReads.delayRead(aRead);
83 }
84 
85 #include "comm.h"
86 
87 void
89 {
91 }
92 
93 #endif /* USE_DELAY_POOLS */
94 
#define assert(EX)
Definition: assert.h:17
CompositePoolNode::Pointer theComposite_
Definition: DelayPool.h:41
acl_access * access
Definition: DelayPool.h:38
void dump_acl_access(StoreEntry *entry, const char *name, acl_access *head)
Definition: cache_cf.cc:1387
int i
Definition: membanger.c:49
virtual void dump(StoreEntry *entry) const =0
void dump(StoreEntry *, unsigned int poolNumberMinusOne) const
Definition: DelayPool.cc:42
DeferredReadManager deferredReads
static CommonPool * Factory(unsigned char _class, CompositePoolNode::Pointer &)
Definition: delay_pools.cc:249
void delayRead(DeferredRead const &)
Definition: DelayPool.cc:80
void createPool(u_char delay_class)
Definition: DelayPool.cc:63
~DelayPool()
Definition: DelayPool.cc:25
void parse()
Definition: DelayPool.cc:35
virtual void parse()=0
void aclDestroyAccessList(acl_access **list)
Definition: Gadgets.cc:284
void delayRead(DeferredRead const &)
Definition: comm.cc:1723
#define LOCAL_ARRAY(type, name, size)
Definition: leakcheck.h:18
void kickReads(int const count)
Definition: comm.cc:1781
CompositePoolNode::Pointer theComposite()
Definition: DelayPool.h:34
CommonPool * pool
Definition: DelayPool.h:33
void freeData()
Definition: DelayPool.cc:72
char const * theClassTypeLabel() const
Definition: CommonPool.h:31
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:904
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors