]>
Commit | Line | Data |
---|---|---|
88a03fda | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
88a03fda | 3 | * |
bbc27441 AJ |
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. | |
88a03fda | 7 | */ |
bbc27441 AJ |
8 | |
9 | /* DEBUG: section 77 Delay Pools */ | |
10 | ||
eb8ed10d AJ |
11 | #ifndef DELAYUSER_H |
12 | #define DELAYUSER_H | |
88a03fda | 13 | |
79fc6915 | 14 | #if USE_DELAY_POOLS && USE_AUTH |
88a03fda | 15 | |
3ad63615 | 16 | #include "auth/Gadgets.h" |
56a49fda | 17 | #include "auth/User.h" |
88a03fda | 18 | #include "CompositePoolNode.h" |
88a03fda | 19 | #include "DelayBucket.h" |
602d9612 | 20 | #include "DelayIdComposite.h" |
88a03fda | 21 | #include "DelaySpec.h" |
29b17d63 | 22 | #include "splay.h" |
88a03fda | 23 | |
63be0a78 | 24 | /// \ingroup DelayPoolsAPI |
62e76326 | 25 | class DelayUserBucket : public RefCountable |
26 | { | |
b58d2a22 | 27 | MEMPROXY_CLASS(DelayUserBucket); |
62e76326 | 28 | |
29 | public: | |
88a03fda | 30 | typedef RefCount<DelayUserBucket> Pointer; |
62e76326 | 31 | |
88a03fda | 32 | void stats(StoreEntry *)const; |
d87154ee | 33 | DelayUserBucket(Auth::User::Pointer); |
337b9aa4 | 34 | ~DelayUserBucket() override; |
88a03fda | 35 | DelayBucket theBucket; |
d87154ee | 36 | Auth::User::Pointer authUser; |
88a03fda | 37 | }; |
38 | ||
63be0a78 | 39 | /// \ingroup DelayPoolsAPI |
62e76326 | 40 | class DelayUser : public CompositePoolNode |
41 | { | |
b58d2a22 | 42 | MEMPROXY_CLASS(DelayUser); |
62e76326 | 43 | |
88a03fda | 44 | public: |
45 | typedef RefCount<DelayUser> Pointer; | |
88a03fda | 46 | DelayUser(); |
337b9aa4 AR |
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; | |
62e76326 | 52 | |
337b9aa4 | 53 | DelayIdComposite::Pointer id(CompositeSelectionDetails &) override; |
88a03fda | 54 | |
55 | private: | |
62e76326 | 56 | |
63be0a78 | 57 | /// \ingroup DelayPoolsInternal |
58 | class Id:public DelayIdComposite | |
62e76326 | 59 | { |
b58d2a22 | 60 | MEMPROXY_CLASS(DelayUser::Id); |
62e76326 | 61 | |
62 | public: | |
d87154ee | 63 | Id(RefCount<DelayUser>, Auth::User::Pointer); |
337b9aa4 AR |
64 | ~Id() override; |
65 | int bytesWanted (int min, int max) const override; | |
66 | void bytesIn(int qty) override; | |
62e76326 | 67 | |
68 | private: | |
75566ba2 | 69 | RefCount<DelayUser> theUser; |
62e76326 | 70 | DelayUserBucket::Pointer theBucket; |
88a03fda | 71 | }; |
62e76326 | 72 | |
0353e724 | 73 | friend class Id; |
74 | ||
88a03fda | 75 | DelaySpec spec; |
29b17d63 | 76 | Splay<DelayUserBucket::Pointer> buckets; |
88a03fda | 77 | }; |
62e76326 | 78 | |
79fc6915 | 79 | #endif /* USE_DELAY_POOLS && USE_AUTH */ |
88a03fda | 80 | #endif /* DELAYUSER_H */ |
f53969cc | 81 |