9#ifndef SQUID_SRC_CLIENTINFO_H
10#define SQUID_SRC_CLIENTINFO_H
21#include "mem/forward.h"
107 void setWriteLimiter(
const int aWriteSpeedLimit,
const double anInitialBurst,
const double aHighWatermark);
#define CBDATA_CLASS(type)
Base class for Squid-to-client bandwidth limiting.
counter for accumulating byte values
struct ClientInfo::Protocol Icp
void reduceBucket(int len) override
Decreases the bucket level.
void quotaDequeue()
pops queue head from queue
bool hasQueue() const
whether any clients are waiting for write quota
void writeOrDequeue()
either selects the head descriptor for writing or calls quotaDequeue()
void setWriteLimiter(const int aWriteSpeedLimit, const double anInitialBurst, const double aHighWatermark)
CommQuotaQueue * quotaQueue
clients waiting for more write quota
void onFdClosed() override
Performs cleanup when the related file descriptor becomes closed.
bool eventWaiting
waiting for commHandleWriteHelper event to fire
void scheduleWrite(Comm::IoCallback *state) override
Will plan another write call.
unsigned int quotaEnqueue(int fd)
client starts waiting in queue; create the queue if necessary
int quota() override
allocate quota for a just dequeued client
int quotaPeekFd() const
returns the next fd reservation
int rationedQuota
precomputed quota preserving fairness among clients
struct ClientInfo::Protocol Http
unsigned int quotaPeekReserv() const
returns the next reservation to pop
int rationedCount
number of clients that will receive rationedQuota
bool firstTimeConnection
is this first time connection for this client
bool applyQuota(int &nleft, Comm::IoCallback *state) override
bool writeLimitingActive
Is write limiter active.
struct ClientInfo::Cutoff cutoff
void quotaDumpQueue()
dumps quota queue for debugging
MEMPROXY_CLASS(ClientInfo)
int ins
number of enqueue calls, used to generate a "reservation" ID
ClientInfo * clientInfo
bucket responsible for quota maintenance
void dequeue()
removes queue head
unsigned int enqueue(int fd)
places the given fd at the end of the queue; returns reservation ID
int outs
number of dequeue calls, used to check the "reservation" ID
Store fds
descriptor queue
Details about a particular Comm IO callback event.
ByteCounter hit_kbytes_out
int result_hist[LOG_TYPE_MAX]