DelayUser.h
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 #ifndef SQUID_SRC_DELAYUSER_H
12 #define SQUID_SRC_DELAYUSER_H
13 
14 #if USE_DELAY_POOLS && USE_AUTH
15 
16 #include "auth/Gadgets.h"
17 #include "auth/User.h"
18 #include "CompositePoolNode.h"
19 #include "DelayBucket.h"
20 #include "DelayIdComposite.h"
21 #include "DelaySpec.h"
22 #include "splay.h"
23 
25 class DelayUserBucket : public RefCountable
26 {
27  MEMPROXY_CLASS(DelayUserBucket);
28 
29 public:
30  typedef RefCount<DelayUserBucket> Pointer;
31 
32  void stats(StoreEntry *)const;
33  DelayUserBucket(Auth::User::Pointer);
34  ~DelayUserBucket() override;
35  DelayBucket theBucket;
36  Auth::User::Pointer authUser;
37 };
38 
40 class DelayUser : public CompositePoolNode
41 {
42  MEMPROXY_CLASS(DelayUser);
43 
44 public:
46  DelayUser();
47  ~DelayUser() override;
48  void stats(StoreEntry * sentry) override;
49  void dump(StoreEntry *entry) const override;
50  void update(int incr) override;
51  void parse() override;
52 
53  DelayIdComposite::Pointer id(CompositeSelectionDetails &) override;
54 
55 private:
56 
58  class Id:public DelayIdComposite
59  {
60  MEMPROXY_CLASS(DelayUser::Id);
61 
62  public:
63  Id(const DelayUser::Pointer &, const Auth::User::Pointer &);
64  ~Id() override;
65  int bytesWanted (int min, int max) const override;
66  void bytesIn(int qty) override;
67 
68  private:
69  RefCount<DelayUser> theUser;
70  DelayUserBucket::Pointer theBucket;
71  };
72 
73  friend class Id;
74 
75  DelaySpec spec;
77 };
78 
79 #endif /* USE_DELAY_POOLS && USE_AUTH */
80 #endif /* SQUID_SRC_DELAYUSER_H */
81 
MEMPROXY_CLASS(CompositePoolNode)
RefCount< CompositePoolNode > Pointer
virtual void parse()=0
virtual void stats(StoreEntry *sentry)=0
const A & max(A const &lhs, A const &rhs)
virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &)=0
Definition: splay.h:49
static struct tok * buckets[HASHSIZE]
Definition: parse.c:219
void update(int incr) override=0
virtual void dump(StoreEntry *entry) const =0
#define MEMPROXY_CLASS(CLASS)
const A & min(A const &lhs, A const &rhs)

 

Introduction

Documentation

Support

Miscellaneous