src/client_db.cc File Reference

#include "squid.h"
#include "event.h"
#include "CacheManager.h"
#include "ClientInfo.h"
#include "ip/Address.h"
#include "SquidMath.h"
#include "SquidTime.h"
#include "Store.h"
Include dependency graph for client_db.cc:

Go to the source code of this file.

Defines

#define CLIENT_DB_HASH_SIZE   467
#define CUTOFF_SECONDS   3600

Functions

static ClientInfoclientdbAdd (const Ip::Address &addr)
static void clientdbStartGC (void)
static void clientdbScheduledGC (void *)
static void clientdbRegisterWithCacheManager (void)
void clientdbInit (void)
void clientdbUpdate (const Ip::Address &addr, log_type ltype, protocol_t p, size_t size)
int clientdbEstablished (const Ip::Address &addr, int delta)
int clientdbCutoffDenied (const Ip::Address &addr)
log_typeoperator++ (log_type &aLogType)
void clientdbDump (StoreEntry *sentry)
static void clientdbFreeItem (void *data)
void clientdbFreeMemory (void)
static void clientdbGC (void *unused)
Ip::Address * client_entry (Ip::Address *current)
variable_listsnmp_meshCtblFn (variable_list *Var, snint *ErrP)

Variables

static hash_tableclient_table = NULL
static FREE clientdbFreeItem
static int max_clients = 32
static int cleanup_running = 0
static int cleanup_scheduled = 0
static int cleanup_removed

Define Documentation

#define CLIENT_DB_HASH_SIZE   467

Definition at line 57 of file client_db.cc.

Referenced by clientdbGC(), and clientdbInit().

#define CUTOFF_SECONDS   3600

Definition at line 167 of file client_db.cc.

Referenced by clientdbCutoffDenied().


Function Documentation

Ip::Address* client_entry ( Ip::Address *  current  ) 
int clientdbEstablished ( const Ip::Address &  addr,
int  delta 
)

This function tracks the number of currently established connections for a client IP address. When a connection is accepted, call this with delta = 1. When the connection is closed, call with delta = -1. To get the current value, simply call with delta = 0.

Definition at line 143 of file client_db.cc.

References c, SquidConfig::client_db, clientdbAdd(), Config, debug_trap(), hash_lookup(), MAX_IPSTRLEN, ClientInfo::n_established, NULL, and SquidConfig::onoff.

Referenced by httpAccept(), httpsAccept(), ACLMaxConnection::match(), Comm::ListenStateData::oldAccept(), and ConnStateData::swanSong().

static void clientdbFreeItem ( void *  data  )  [static]

Definition at line 298 of file client_db.cc.

References c, ClientInfo::hash, _hash_link::key, MEM_CLIENT_INFO, memFree(), and safe_free.

void clientdbFreeMemory ( void   ) 

Definition at line 306 of file client_db.cc.

References clientdbFreeItem, hashFreeItems(), and hashFreeMemory().

Referenced by SquidShutdown().

void clientdbInit ( void   ) 
static void clientdbRegisterWithCacheManager ( void   )  [static]

Definition at line 80 of file client_db.cc.

References clientdbDump(), and CacheManager::GetInstance().

Referenced by clientdbInit().

static void clientdbScheduledGC ( void *  unused  )  [static]

Definition at line 314 of file client_db.cc.

References cleanup_scheduled, and clientdbStartGC().

Referenced by clientdbAdd(), and clientdbGC().

static void clientdbStartGC ( void   )  [static]
log_type& operator++ ( log_type aLogType  ) 

Definition at line 227 of file client_db.cc.


Variable Documentation

int cleanup_removed [static]

Definition at line 55 of file client_db.cc.

Referenced by clientdbGC(), and clientdbStartGC().

int cleanup_running = 0 [static]

Definition at line 53 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().

int cleanup_scheduled = 0 [static]

Definition at line 54 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbScheduledGC().

hash_table* client_table = NULL [static]

Definition at line 45 of file client_db.cc.

FREE clientdbFreeItem [static]

Definition at line 48 of file client_db.cc.

Referenced by clientdbFreeMemory(), and clientdbGC().

int max_clients = 32 [static]

Definition at line 52 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().

Search

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors