#include <pconn.h>

Inheritance diagram for IdleConnList:
Collaboration diagram for IdleConnList:

Public Member Functions

void * operator new (size_t size)
void operator delete (void *address)
void * toCbdata () noexcept
 IdleConnList (const char *key, PconnPool *parent)
 ~IdleConnList ()
void push (const Comm::ConnectionPointer &conn)
 Pass control of the connection to the idle list. More...
Comm::ConnectionPointer pop ()
 get first conn which is not pending read fd. More...
Comm::ConnectionPointer findUseable (const Comm::ConnectionPointer &key)
void clearHandlers (const Comm::ConnectionPointer &conn)
int count () const
void closeN (size_t count)
virtual void endingShutdown ()

Public Attributes

void * key

Private Types

typedef void(RegisteredRunner::* Method) ()
 a pointer to one of the above notification methods More...

Private Member Functions

bool isAvailable (int i) const
bool removeAt (int index)
int findIndexOf (const Comm::ConnectionPointer &conn) const
void findAndClose (const Comm::ConnectionPointer &conn)
void registerRunner ()
void unregisterRunner ()
 unregisters self; safe to call multiple times More...
virtual void bootstrapConfig ()
virtual void finalizeConfig ()
virtual void claimMemoryNeeds ()
virtual void useConfig ()
virtual void startReconfigure ()
virtual void syncConfig ()
virtual void startShutdown ()
virtual void finishShutdown ()
 Meant for cleanup of services needed by the already destroyed objects. More...

Private Attributes

int capacity_
 Number of entries theList can currently hold without re-allocating (capacity). More...
int size_
char fakeReadBuf_ [4096]

Static Private Attributes

static cbdata_type CBDATA_IdleConnList = CBDATA_UNKNOWN
static IOCB Read
static CTCB Timeout

Detailed Description

A list of connections currently open to a particular destination end-point.

Definition at line 37 of file pconn.h.

Member Typedef Documentation

◆ Method

typedef void(RegisteredRunner::* RegisteredRunner::Method) ()

Definition at line 94 of file RunnersRegistry.h.

Constructor & Destructor Documentation

◆ IdleConnList()

IdleConnList::IdleConnList ( const char *  key,
PconnPool parent 

◆ ~IdleConnList()

IdleConnList::~IdleConnList ( )

Definition at line 50 of file pconn.cc.

References closeN(), hash_link::key, NULL, parent_, size_, theList_, PconnPool::unlinkList(), and xfree.

Member Function Documentation

◆ bootstrapConfig()

virtual void RegisteredRunner::bootstrapConfig ( )

Called right before parsing squid.conf. Meant for initializing/preparing configuration parsing facilities.

Definition at line 46 of file RunnersRegistry.h.

Referenced by SquidMain().

◆ claimMemoryNeeds()

virtual void RegisteredRunner::claimMemoryNeeds ( )

Called after finalizeConfig(). Meant for announcing memory reservations before memory is allocated.

Reimplemented in MemStoreRr, and IpcIoRr.

Definition at line 55 of file RunnersRegistry.h.

Referenced by RunConfigUsers().

◆ clearHandlers()

void IdleConnList::clearHandlers ( const Comm::ConnectionPointer conn)

Definition at line 160 of file pconn.cc.

References comm_read_cancel(), commUnsetConnTimeout(), conn, debugs, and Read.

Referenced by closeN(), findAndClose(), findUseable(), and pop().

◆ closeN()

void IdleConnList::closeN ( size_t  count)

◆ count()

int IdleConnList::count ( ) const

Definition at line 61 of file pconn.h.

References size_.

Referenced by PconnPool::unlinkList().

◆ endingShutdown()

void IdleConnList::endingShutdown ( )

Called after shutdown_lifetime grace period ends and before stopping the main loop. At least one main loop iteration is guaranteed after this call. Meant for cleanup and state saving that may require other modules.

Reimplemented from RegisteredRunner.

Definition at line 323 of file pconn.cc.

References closeN(), and size_.

◆ finalizeConfig()

virtual void RegisteredRunner::finalizeConfig ( )

Called after parsing squid.conf. Meant for setting configuration options that depend on other configuration options and were not explicitly configured.

Reimplemented in MemStoreRr, and sslBumpCfgRr.

Definition at line 51 of file RunnersRegistry.h.

Referenced by SquidMain().

◆ findAndClose()

void IdleConnList::findAndClose ( const Comm::ConnectionPointer conn)

Definition at line 284 of file pconn.cc.

References clearHandlers(), conn, findIndexOf(), PconnPool::notifyManager(), parent_, and removeAt().

◆ findIndexOf()

int IdleConnList::findIndexOf ( const Comm::ConnectionPointer conn) const

Search the list. Matches by FD socket number. Performed from the end of list where newest entries are.

Return values
<0The connection is not listed
>=0The connection array index

Definition at line 72 of file pconn.cc.

References conn, debugs, Comm::Connection::fd, size_, and theList_.

Referenced by findAndClose().

◆ findUseable()

Comm::ConnectionPointer IdleConnList::findUseable ( const Comm::ConnectionPointer key)

Search the list for a connection which matches the 'key' details and pop it off the list. The list is created based on remote IP:port hash. This further filters the choices based on specific local-end details requested. If nothing usable is found the a nil pointer is returned.

Definition at line 245 of file pconn.cc.

References assert, clearHandlers(), fd_table, Ip::Address::isAnyAddr(), isAvailable(), Comm::Connection::local, Ip::Address::matchIPAddr(), NULL, Ip::Address::port(), removeAt(), size_, and theList_.

Referenced by PconnPool::popStored().

◆ finishShutdown()

virtual void RegisteredRunner::finishShutdown ( )

Definition at line 91 of file RunnersRegistry.h.

Referenced by RunRegistered(), SquidShutdown(), testRock::tearDown(), and watch_child().

◆ isAvailable()

bool IdleConnList::isAvailable ( int  i) const

Determine whether an entry in the idle list is available for use. Returns false if the entry is unset, closed or closing.

Definition at line 197 of file pconn.cc.

References COMMIO_FD_READCB, conn, Comm::IsConnOpen(), and theList_.

Referenced by findUseable(), and pop().

◆ operator delete()

void IdleConnList::operator delete ( void *  address)

Definition at line 39 of file pconn.h.

◆ operator new()

void* IdleConnList::operator new ( size_t  size)

Definition at line 39 of file pconn.h.

◆ pop()

Comm::ConnectionPointer IdleConnList::pop ( )

Definition at line 213 of file pconn.cc.

References clearHandlers(), fd_table, isAvailable(), NULL, removeAt(), size_, and theList_.

◆ push()

◆ registerRunner()

void IndependentRunner::registerRunner ( )

◆ removeAt()

bool IdleConnList::removeAt ( int  index)

Remove the entry at specified index. May perform a shuffle of list entries to fill the gap.

Return values
falseThe index is not an in-use entry.

Definition at line 90 of file pconn.cc.

References debugs, hashKeyStr(), PconnPool::noteConnectionRemoved(), NULL, parent_, size_, and theList_.

Referenced by findAndClose(), findUseable(), and pop().

◆ startReconfigure()

virtual void RegisteredRunner::startReconfigure ( )

Called after receiving a reconfigure request and before parsing squid.conf. Meant for modules that need to prepare for their configuration being changed [outside their control]. The changes end with the syncConfig() event.

Reimplemented in Dns::ConfigRr.

Definition at line 67 of file RunnersRegistry.h.

Referenced by mainReconfigureStart().

◆ startShutdown()

virtual void RegisteredRunner::startShutdown ( )

Called after receiving a shutdown request and before stopping the main loop. At least one main loop iteration is guaranteed after this call. Meant for cleanup and state saving that may require other modules.

Reimplemented in Rock::Rebuild, and ConnStateData.

Definition at line 78 of file RunnersRegistry.h.

Referenced by SignalEngine::doShutdown().

◆ syncConfig()

virtual void RegisteredRunner::syncConfig ( )

Called after parsing squid.conf during reconfiguration. Meant for adjusting the module state based on configuration changes.

Reimplemented in Auth::CredentialCacheRr, and PeerPoolMgrsRr.

Definition at line 71 of file RunnersRegistry.h.

Referenced by mainReconfigureFinish().

◆ toCbdata()

void* IdleConnList::toCbdata ( )

Definition at line 39 of file pconn.h.

◆ unregisterRunner()

void IndependentRunner::unregisterRunner ( )

Definition at line 96 of file RunnersRegistry.cc.

References FindRunners().

Referenced by IndependentRunner::~IndependentRunner().

◆ useConfig()

virtual void RegisteredRunner::useConfig ( )

Called after claimMemoryNeeds(). Meant for activating modules and features using a finalized configuration with known memory requirements.

Reimplemented in TransientsRr, SharedSessionCacheRr, PeerPoolMgrsRr, MemStoreRr, Ipc::Mem::RegisteredRunner, SharedMemPagesRr, and ClientDbRr.

Definition at line 60 of file RunnersRegistry.h.

Referenced by RunConfigUsers().

Member Data Documentation

◆ capacity_

int IdleConnList::capacity_

Number of in-use entries in theList

Definition at line 83 of file pconn.h.

Referenced by IdleConnList(), and push().

◆ CBDATA_IdleConnList

cbdata_type IdleConnList::CBDATA_IdleConnList = CBDATA_UNKNOWN

Definition at line 39 of file pconn.h.

◆ fakeReadBuf_

char IdleConnList::fakeReadBuf_[4096]

Definition at line 94 of file pconn.h.

Referenced by push().

◆ key

void* hash_link::key

Definition at line 19 of file hash.h.

Referenced by ClientInfo::ClientInfo(), fqdncache_entry::fqdncache_entry(), IdleConnList(), ipcache_entry::ipcache_entry(), net_db_name::net_db_name(), ClientInfo::~ClientInfo(), ExternalACLEntry::~ExternalACLEntry(), fqdncache_entry::~fqdncache_entry(), ~IdleConnList(), net_db_name::~net_db_name(), aclMatchExternal(), MemStore::anchorToCache(), Rock::SwapDir::anchorToCache(), StoreMetaMD5::checkConsistency(), StoreEntry::clearPublicKeyScope(), Rock::SwapDir::createStoreIO(), CommQuotaQueue::dequeue(), destroyStoreEntry(), CommQuotaQueue::enqueue(), external_acl_cache_add(), StoreEntry::forcePublicKey(), fqdncacheAddEntry(), fqdncacheParse(), StoreEntry::getMD5Text(), hash_join(), hash_remove_link(), StoreEntry::hashDelete(), StoreEntry::hashInsert(), hashKeyStr(), Rock::SwapDir::hasReadableEntry(), htcpQuery(), idnsStartQuery(), ipcacheAddEntry(), ipcacheRelease(), Fs::Ufs::UFSSwapDir::logEntry(), Store::Controller::markedForDeletionAndAbandoned(), my_free(), ipcache_entry::name(), neighborsUdpPing(), netdbHashInsert(), Ipc::StoreMap::openForUpdating(), Rock::SwapDir::openStoreIO(), peerCountMcastPeersCreateAndSend(), StoreEntry::publicKey(), read_passwd_file(), Ipc::StoreMapAnchor::set(), StoreEntry::setPrivateKey(), StoreEntry::setPublicKey(), ClientInfo::setWriteLimiter(), Ident::Start(), MemStore::startCaching(), storeDigestAdd(), storeDigestDel(), storeKeyHashHash(), storeKeyText(), storeRebuildParseEntry(), storeSwapMetaBuild(), and UFSCleanLog::write().

◆ next

◆ parent_

PconnPool* IdleConnList::parent_

The pool containing this sub-list. The parent performs all stats accounting, and will delete us when it dies. It persists for the full duration of our existence.

Definition at line 92 of file pconn.h.

Referenced by ~IdleConnList(), closeN(), findAndClose(), push(), and removeAt().

◆ Read

void IdleConnList::Read

Definition at line 71 of file pconn.h.

Referenced by clearHandlers(), and push().

◆ size_

int IdleConnList::size_

◆ theList_

Comm::ConnectionPointer* IdleConnList::theList_

List of connections we are holding. Sorted as FIFO list for most efficient speeds on pop() and findUsable() The worst-case pop() and scans occur on timeout and link closure events where timing is less critical. Occasional slow additions are okay.

Definition at line 80 of file pconn.h.

Referenced by IdleConnList(), ~IdleConnList(), closeN(), findIndexOf(), findUseable(), isAvailable(), pop(), push(), and removeAt().

◆ Timeout

void IdleConnList::Timeout

Definition at line 72 of file pconn.h.

Referenced by push().

The documentation for this class was generated from the following files:






Web Site Translations