9#ifndef SQUID_SRC_BANDWIDTHBUCKET_H
10#define SQUID_SRC_BANDWIDTHBUCKET_H
22 BandwidthBucket(
const int speed,
const int initialLevelPercent,
const double sizeLimit);
Base class for Squid-to-client bandwidth limiting.
bool noLimit() const
Whether this bucket will not do bandwidth limiting.
double bucketLevel
how much can be written now
void refillBucket()
Increases the bucket level with the writeSpeedLimit speed.
double bucketSizeLimit
maximum bucket size
virtual ~BandwidthBucket()
virtual void onFdClosed()
Performs cleanup when the related file descriptor becomes closed.
double prevTime
previous time when we checked
virtual bool applyQuota(int &nleft, Comm::IoCallback *state)
double writeSpeedLimit
Write speed limit in bytes per second.
static BandwidthBucket * SelectBucket(fde *f)
virtual void reduceBucket(const int len)
Decreases the bucket level.
bool selectWaiting
is between commSetSelect and commHandleWrite
virtual void scheduleWrite(Comm::IoCallback *state)=0
Will plan another write call.
Details about a particular Comm IO callback event.