#include <helper.h>

Inheritance diagram for statefulhelper:
Collaboration diagram for statefulhelper:

Public Member Functions

void * operator new (size_t size)
 
void operator delete (void *address)
 
void * toCbdata () noexcept
 
 statefulhelper (const char *name)
 
 ~statefulhelper ()
 
Helper::XactionnextRequest ()
 
bool trySubmit (const char *buf, HLPCB *callback, void *data)
 If possible, submit request. Otherwise, either kill Squid or return false. More...
 
void submitRequest (Helper::Xaction *r)
 
void packStatsInto (Packable *p, const char *label=NULL) const
 Dump some stats about the helper state to a Packable object. More...
 
bool willOverload () const
 

Public Attributes

wordlistcmdline
 
dlink_list servers
 
std::queue< Helper::Xaction * > queue
 
const char * id_name
 
Helper::ChildConfig childs
 Configuration settings for number running. More...
 
int ipc_type
 
Ip::Address addr
 
unsigned int droppedRequests
 requests not sent during helper overload More...
 
time_t overloadStart
 when the helper became overloaded (zero if it is not) More...
 
time_t last_queue_warn
 
time_t last_restart
 
time_t timeout
 Requests timeout. More...
 
bool retryTimedOut
 Whether the timed-out requests must retried. More...
 
bool retryBrokenHelper
 Whether the requests must retried on BH replies. More...
 
SBuf onTimedOutResponse
 The response to use when helper response timedout. More...
 
char eom
 The char which marks the end of (response) message, normally '
'. More...
 
struct helper::_stats stats
 

Protected Member Functions

bool queueFull () const
 whether queuing an additional request would overload the helper More...
 
bool overloaded () const
 
void syncQueueStats ()
 synchronizes queue-dependent measurements with the current queue state More...
 
bool prepSubmit ()
 
void submit (const char *buf, HLPCB *callback, void *data)
 dispatches or enqueues a helper requests; does not enforce queue limits More...
 

Private Member Functions

void submit (const char *buf, HLPCB *callback, void *data, helper_stateful_server *lastserver)
 
bool trySubmit (const char *buf, HLPCB *callback, void *data, helper_stateful_server *lastserver)
 If possible, submit request. Otherwise, either kill Squid or return false. More...
 

Static Private Attributes

static cbdata_type CBDATA_statefulhelper = CBDATA_UNKNOWN
 

Friends

void helperStatefulSubmit (statefulhelper *hlp, const char *buf, HLPCB *callback, void *data, helper_stateful_server *lastserver)
 lastserver = "server last used as part of a reserved request sequence" More...
 

Detailed Description

Definition at line 132 of file helper.h.

Constructor & Destructor Documentation

◆ statefulhelper()

statefulhelper::statefulhelper ( const char *  name)
inline

Definition at line 137 of file helper.h.

◆ ~statefulhelper()

statefulhelper::~statefulhelper ( )
inline

Definition at line 138 of file helper.h.

References buf, callback, data, and helperStatefulSubmit().

Member Function Documentation

◆ nextRequest()

Helper::Xaction * helper::nextRequest ( )
inherited
Returns
next request in the queue, or nil.

Definition at line 1217 of file helper.cc.

References HelperServerBase::stats.

Referenced by helperKickQueue(), and helperStatefulKickQueue().

◆ operator delete()

void statefulhelper::operator delete ( void *  address)
inline

Definition at line 134 of file helper.h.

◆ operator new()

void* statefulhelper::operator new ( size_t  size)
inline

Definition at line 134 of file helper.h.

◆ overloaded()

bool helper::overloaded ( ) const
protectedinherited

Definition at line 410 of file helper.cc.

References HelperServerBase::stats.

◆ packStatsInto()

◆ prepSubmit()

bool helper::prepSubmit ( )
protectedinherited

prepares the helper for request submission returns true if and only if the submission should proceed may kill Squid if the helper remains overloaded for too long

Definition at line 443 of file helper.cc.

References Helper::ChildConfig::actDie, DBG_IMPORTANT, debugs, fatalf(), and squid_curtime.

◆ queueFull()

bool helper::queueFull ( ) const
protectedinherited

Definition at line 405 of file helper.cc.

References HelperServerBase::stats.

◆ submit() [1/2]

void helper::submit ( const char *  buf,
HLPCB callback,
void *  data 
)
protectedinherited

Definition at line 481 of file helper.cc.

References DBG_DATA, and debugs.

◆ submit() [2/2]

◆ submitRequest()

void helper::submitRequest ( Helper::Xaction r)
inherited

Submits a request to the helper or add it to the queue if none of the servers is available.

Definition at line 370 of file helper.cc.

References Enqueue(), GetFirstAvailable(), and helperDispatch().

Referenced by helperReturnBuffer().

◆ syncQueueStats()

void helper::syncQueueStats ( )
protectedinherited

Definition at line 416 of file helper.cc.

References DBG_IMPORTANT, debugs, and squid_curtime.

◆ toCbdata()

void* statefulhelper::toCbdata ( )
inlinenoexcept

Definition at line 134 of file helper.h.

◆ trySubmit() [1/2]

bool helper::trySubmit ( const char *  buf,
HLPCB callback,
void *  data 
)
inherited

Definition at line 470 of file helper.cc.

Referenced by helperSubmit(), and ExternalACLLookup::Start().

◆ trySubmit() [2/2]

bool statefulhelper::trySubmit ( const char *  buf,
HLPCB callback,
void *  data,
helper_stateful_server lastserver 
)
private

Definition at line 498 of file helper.cc.

Referenced by helperStatefulSubmit().

◆ willOverload()

bool helper::willOverload ( ) const
inherited

whether the helper will be in "overloaded" state after one more request already overloaded helpers return true

Definition at line 611 of file helper.cc.

References GetFirstAvailable().

Referenced by aclMatchExternal(), redirectStart(), and storeIdStart().

Friends And Related Function Documentation

◆ helperStatefulSubmit

void helperStatefulSubmit ( statefulhelper hlp,
const char *  buf,
HLPCB callback,
void *  data,
helper_stateful_server lastserver 
)
friend

Definition at line 490 of file helper.cc.

Member Data Documentation

◆ addr

Ip::Address helper::addr
inherited

Definition at line 104 of file helper.h.

Referenced by helperOpenServers(), and helperStatefulOpenServers().

◆ CBDATA_statefulhelper

cbdata_type statefulhelper::CBDATA_statefulhelper = CBDATA_UNKNOWN
staticprivate

Definition at line 134 of file helper.h.

◆ childs

◆ cmdline

wordlist* helper::cmdline
inherited

◆ droppedRequests

unsigned int helper::droppedRequests
inherited

Definition at line 105 of file helper.h.

◆ eom

char helper::eom
inherited

Definition at line 113 of file helper.h.

Referenced by helperHandleRead(), and helperStatefulHandleRead().

◆ id_name

◆ ipc_type

int helper::ipc_type
inherited

◆ last_queue_warn

time_t helper::last_queue_warn
inherited

Definition at line 107 of file helper.h.

Referenced by Enqueue(), and StatefulEnqueue().

◆ last_restart

time_t helper::last_restart
inherited

◆ onTimedOutResponse

SBuf helper::onTimedOutResponse
inherited

Definition at line 112 of file helper.h.

Referenced by redirectInit().

◆ overloadStart

time_t helper::overloadStart
inherited

Definition at line 106 of file helper.h.

◆ queue

std::queue<Helper::Xaction *> helper::queue
inherited

Definition at line 100 of file helper.h.

Referenced by Enqueue(), and StatefulEnqueue().

◆ retryBrokenHelper

bool helper::retryBrokenHelper
inherited

Definition at line 111 of file helper.h.

Referenced by redirectInit().

◆ retryTimedOut

bool helper::retryTimedOut
inherited

Definition at line 110 of file helper.h.

Referenced by helperReturnBuffer(), redirectInit(), and helper_server::requestTimeout().

◆ servers

◆ stats

◆ timeout

time_t helper::timeout
inherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors