]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/MessageBucket.h
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
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.
9 #ifndef MESSAGEBUCKET_H
10 #define MESSAGEBUCKET_H
14 #include "BandwidthBucket.h"
15 #include "base/RefCount.h"
16 #include "comm/forward.h"
17 #include "MessageDelayPools.h"
19 /// Limits Squid-to-client bandwidth for each matching response
20 class MessageBucket
: public RefCountable
, public BandwidthBucket
22 MEMPROXY_CLASS(MessageBucket
);
25 typedef RefCount
<MessageBucket
> Pointer
;
27 MessageBucket(const int speed
, const int initialLevelPercent
, const double sizeLimit
, MessageDelayPool::Pointer pool
);
29 /* BandwidthBucket API */
30 virtual int quota() override
;
31 virtual void scheduleWrite(Comm::IoCallback
*state
) override
;
32 virtual void reduceBucket(int len
) override
;
35 MessageDelayPool::Pointer theAggregate
;
38 #endif /* USE_DELAY_POOLS */