DelayPool.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
20DelayPool::DelayPool() : pool (nullptr), access (nullptr)
21{
23}
24
26{
27 if (pool)
28 freeData();
29
30 if (access)
32}
33
34void
36{
37 assert(theComposite() != nullptr);
39}
40
41void
42DelayPool::dump(StoreEntry *entry, unsigned int i) const
43{
44 if (theComposite() == nullptr)
45 return;
46
47 storeAppendPrintf(entry, "delay_class %d " SQUIDSBUFPH "\n", i + 1, SQUIDSBUFPRINT(pool->classTypeLabel()));
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
62void
63DelayPool::createPool(u_char delay_class)
64{
65 if (pool)
66 freeData();
67
69}
70
71void
73{
74 delete pool;
75 pool = nullptr;
76}
77
78// TODO: create DelayIdComposite.cc
79void
81{
82 deferredReads.delay(aRead);
83}
84
85#include "comm.h"
86
87void
89{
91}
92
93#endif /* USE_DELAY_POOLS */
94
#define SQUIDSBUFPH
Definition: SBuf.h:31
#define SQUIDSBUFPRINT(s)
Definition: SBuf.h:32
#define assert(EX)
Definition: assert.h:17
const SBuf & classTypeLabel() const
Definition: CommonPool.h:31
static CommonPool * Factory(unsigned char _class, CompositePoolNode::Pointer &)
Definition: delay_pools.cc:248
virtual void parse()=0
virtual void dump(StoreEntry *entry) const =0
DelayedAsyncCalls deferredReads
void delayRead(const AsyncCallPointer &)
Definition: DelayPool.cc:80
void parse()
Definition: DelayPool.cc:35
acl_access * access
Definition: DelayPool.h:38
~DelayPool()
Definition: DelayPool.cc:25
CompositePoolNode::Pointer theComposite()
Definition: DelayPool.h:34
void dump(StoreEntry *, unsigned int poolNumberMinusOne) const
Definition: DelayPool.cc:42
CommonPool * pool
Definition: DelayPool.h:33
CompositePoolNode::Pointer theComposite_
Definition: DelayPool.h:41
void freeData()
Definition: DelayPool.cc:72
void createPool(u_char delay_class)
Definition: DelayPool.cc:63
void schedule()
schedules and forgets all async calls previously stored by delay()
void delay(const AsyncCallPointer &)
stores the given call to schedule it at schedule() or destruction time
void aclDestroyAccessList(acl_access **list)
Definition: Gadgets.cc:276
void dump_acl_access(StoreEntry *entry, const char *name, acl_access *head)
Definition: cache_cf.cc:1516
#define LOCAL_ARRAY(type, name, size)
Definition: squid.h:68
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:841

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors