#include "squid.h"
#include "base/AsyncCbdataCalls.h"
#include "base/Packable.h"
#include "base/Raw.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/Read.h"
#include "comm/Write.h"
#include "debug/Messages.h"
#include "fd.h"
#include "fde.h"
#include "format/Quoting.h"
#include "helper.h"
#include "helper/Reply.h"
#include "helper/Request.h"
#include "MemBuf.h"
#include "SquidConfig.h"
#include "SquidIpc.h"
#include "SquidMath.h"
#include "Store.h"
#include "wordlist.h"
#include "mem/Pool.h"
Go to the source code of this file.
Macros | |
#define | HELPER_MAX_ARGS 64 |
#define | MAX_RETRIES 2 |
The maximum allowed request retries. More... | |
Variables | |
static IOCB | helperHandleRead |
static IOCB | helperStatefulHandleRead |
Macro Definition Documentation
◆ HELPER_MAX_ARGS
◆ MAX_RETRIES
Function Documentation
◆ Enqueue()
|
static |
Definition at line 1239 of file helper.cc.
References Helper::Client::childs, DBG_CRITICAL, debugs, Helper::Client::id_name, Helper::Client::last_queue_warn, Helper::ChildConfig::n_active, Helper::ChildConfig::n_max, Helper::ChildConfig::needNew(), Helper::Client::openSessions(), Helper::Client::queue, Helper::Client::_stats::queue_size, Helper::ChildConfig::queue_size, reconfiguring, shutting_down, squid_curtime, and Helper::Client::stats.
Referenced by Helper::Client::submitRequest().
◆ GetFirstAvailable()
|
static |
Definition at line 1307 of file helper.cc.
References Helper::Client::childs, Helper::ChildConfig::concurrency, dlink_node::data, debugs, dlink_list::head, Helper::SessionBase::index, Helper::ChildConfig::n_running, dlink_node::next, Helper::SessionBase::pending, Helper::Client::servers, and Helper::SessionBase::stats.
Referenced by helperKickQueue(), Helper::Client::submitRequest(), and Helper::Client::willOverload().
◆ helperDispatch()
|
static |
Definition at line 1422 of file helper.cc.
References MemBuf::append(), Packable::appendf(), assert, Helper::Request::buf, cbdataReferenceValid(), commCbCall(), MemBuf::content(), MemBuf::contentSize(), current_time, Helper::Request::data, DBG_IMPORTANT, debugs, Helper::Request::dispatch_time, Helper::SessionBase::flags, helperDispatchWriteDone(), Helper::Request::Id, Helper::SessionBase::index, MemBuf::init(), MemBuf::isNull(), Helper::Session::nextRequestId, Helper::Session::parent, Helper::SessionBase::pending, PRIu64, Helper::Xaction::request, Helper::SessionBase::requests, Helper::Session::requestsIndex, Helper::SessionBase::stats, Helper::SessionBase::uses, Helper::Session::wqueue, Comm::Write(), Helper::Session::writebuf, Helper::SessionBase::writePipe, and Helper::SessionBase::_helper_flags::writing.
Referenced by helperKickQueue(), and Helper::Client::submitRequest().
◆ helperDispatchWriteDone()
|
static |
Definition at line 1396 of file helper.cc.
References MemBuf::clean(), commCbCall(), DBG_CRITICAL, debugs, helperDispatchWriteDone(), Comm::OK, Comm::Write(), and Helper::Session::writebuf.
Referenced by helperDispatch(), and helperDispatchWriteDone().
◆ helperHandleRead()
|
static |
Definition at line 1011 of file helper.cc.
References assert, cbdataReferenceValid(), comm_read(), commCbCall(), conn, DBG_DATA, DBG_IMPORTANT, debugs, Comm::ERR_CLOSING, fd_table, helperHandleRead, helperReturnBuffer(), Comm::IsConnOpen(), Comm::OK, Helper::Session::parent, and xisspace.
◆ helperKickQueue()
|
static |
Definition at line 1517 of file helper.cc.
References GetFirstAvailable(), helperDispatch(), and Helper::Client::nextRequest().
Referenced by helperReturnBuffer(), and Helper::Client::openSessions().
◆ helperReturnBuffer()
|
static |
Definition at line 951 of file helper.cc.
References Helper::SessionBase::answer_time, Helper::Client::_stats::avg_svc_time, Helper::BrokenHelper, Helper::Client::callBack(), cbdataReferenceValid(), Helper::Session::checkForTimedOutRequests(), Helper::Client::childs, Helper::SessionBase::closePipesSafely(), Helper::SessionBase::closeWritePipeSafely(), Helper::SessionBase::_helper_flags::closing, Helper::ChildConfig::concurrency, current_time, DBG_IMPORTANT, debugs, Helper::SessionBase::dispatch_time, Helper::SessionBase::flags, helperKickQueue(), Helper::Client::id_name, Helper::SessionBase::index, Math::intAverage(), MAX_RETRIES, Helper::Session::parent, Helper::SessionBase::pending, Helper::SessionBase::rbuf_sz, REDIRECT_AV_FACTOR, Helper::Client::_stats::replies, Helper::SessionBase::replies, Helper::Session::replyXaction, Helper::Xaction::request, Helper::Request::retries, Helper::Client::retryTimedOut, Helper::SessionBase::_helper_flags::shutdown, Helper::Client::stats, Helper::SessionBase::stats, Helper::Client::submitRequest(), Helper::Client::timeout, and tvSubMsec().
Referenced by helperHandleRead().
◆ helperShutdown()
void helperShutdown | ( | const Helper::Client::Pointer & | hlp | ) |
Definition at line 771 of file helper.cc.
References assert, Helper::Client::childs, dlink_node::data, debugs, dlink_list::head, Helper::Client::id_name, Helper::ChildConfig::n_active, dlink_node::next, and Helper::Client::servers.
Referenced by external_acl::~external_acl(), externalAclShutdown(), redirectShutdown(), Ssl::Helper::Shutdown(), and Ssl::CertValidationHelper::Shutdown().
◆ helperStatefulDispatch()
|
static |
Definition at line 1469 of file helper.cc.
References assert, Helper::Request::buf, cbdataReferenceValid(), commCbCall(), current_time, Helper::Request::data, DBG_IMPORTANT, debugs, Helper::SessionBase::dispatch_time, helperStatefulDispatchWriteDone(), helperStatefulServerDone(), Helper::SessionBase::index, helper_stateful_server::parent, Helper::SessionBase::pending, Helper::Request::placeholder, Helper::Xaction::reply, Helper::Xaction::request, Helper::SessionBase::requests, helper_stateful_server::reservationId, Helper::Reply::reservationId, Helper::Reply::result, Helper::SessionBase::stats, Helper::Unknown, Helper::SessionBase::uses, Comm::Write(), and Helper::SessionBase::writePipe.
Referenced by helperStatefulKickQueue(), and statefulhelper::submit().
◆ helperStatefulDispatchWriteDone()
|
static |
Definition at line 1465 of file helper.cc.
Referenced by helperStatefulDispatch().
◆ helperStatefulHandleRead()
|
static |
BUG: the below assumes that only one response per read() was received and discards any octets remaining. Doing this prohibits concurrency support with multiple replies per read(). TODO: check that read() setup on these buffers pays attention to roffest!=0 TODO: check that replies bigger than the buffer are discarded and do not to affect future replies
Definition at line 1129 of file helper.cc.
References Helper::SessionBase::answer_time, assert, cbdataReferenceValid(), Helper::SessionBase::closePipesSafely(), comm_read(), commCbCall(), conn, current_time, DBG_DATA, DBG_IMPORTANT, debugs, Helper::SessionBase::dispatch_time, Comm::ERR_CLOSING, Comm::Connection::fd, fd_table, helperStatefulHandleRead, helperStatefulServerDone(), Helper::SessionBase::index, Math::intAverage(), Comm::IsConnOpen(), Comm::OK, helper_stateful_server::parent, Helper::SessionBase::pending, Helper::SessionBase::rbuf, Helper::SessionBase::rbuf_sz, Helper::SessionBase::readPipe, REDIRECT_AV_FACTOR, Helper::SessionBase::replies, Helper::SessionBase::requests, helper_stateful_server::reservationId, Helper::SessionBase::roffset, Helper::SessionBase::stats, and tvSubMsec().
◆ helperStatefulKickQueue()
|
static |
Definition at line 1527 of file helper.cc.
References debugs, helperStatefulDispatch(), Helper::SessionBase::index, Helper::Client::nextRequest(), statefulhelper::reserveServer(), and StatefulGetFirstAvailable().
Referenced by helperStatefulServerDone(), and statefulhelper::openSessions().
◆ helperStatefulServerDone()
|
static |
Definition at line 1539 of file helper.cc.
References Helper::SessionBase::closeWritePipeSafely(), Helper::SessionBase::_helper_flags::closing, Helper::SessionBase::flags, helperStatefulKickQueue(), Helper::Client::id_name, helper_stateful_server::parent, Helper::SessionBase::pending, helper_stateful_server::reserved(), Helper::SessionBase::_helper_flags::shutdown, and Helper::SessionBase::stats.
Referenced by statefulhelper::cancelReservation(), helperStatefulDispatch(), and helperStatefulHandleRead().
◆ helperStatefulShutdown()
void helperStatefulShutdown | ( | const statefulhelper::Pointer & | hlp | ) |
Definition at line 807 of file helper.cc.
References assert, Helper::Client::childs, Helper::SessionBase::closePipesSafely(), Helper::SessionBase::_helper_flags::closing, dlink_node::data, debugs, Helper::SessionBase::flags, dlink_list::head, Helper::Client::id_name, Helper::SessionBase::index, Helper::ChildConfig::n_active, dlink_node::next, Helper::SessionBase::pending, helper_stateful_server::reserved(), Helper::Client::servers, Helper::SessionBase::_helper_flags::shutdown, shutting_down, and Helper::SessionBase::stats.
◆ helperStatefulSubmit()
void helperStatefulSubmit | ( | const statefulhelper::Pointer & | hlp, |
const char * | buf, | ||
HLPCB * | callback, | ||
void * | data, | ||
const Helper::ReservationId & | reservation | ||
) |
Submit request or callback the caller with a Helper::Error error. If the reservation is not set then reserves a new helper.
◆ helperSubmit()
void helperSubmit | ( | const Helper::Client::Pointer & | hlp, |
const char *const | buf, | ||
HLPCB *const | callback, | ||
void *const | data | ||
) |
Definition at line 480 of file helper.cc.
References SubmissionFailure(), and Helper::Client::trySubmit().
Referenced by constructHelperQuery().
◆ InstanceIdDefinitions()
InstanceIdDefinitions | ( | Helper::SessionBase | , |
"Hlpr" | |||
) |
◆ ReadBufSize()
const size_t ReadBufSize | ( | 32 * | 1024 | ) |
Referenced by Helper::Client::openSessions(), and statefulhelper::openSessions().
◆ StatefulEnqueue()
|
static |
Definition at line 1267 of file helper.cc.
References Helper::Client::childs, DBG_CRITICAL, debugs, Helper::Client::id_name, Helper::Client::last_queue_warn, Helper::ChildConfig::n_active, Helper::ChildConfig::n_max, Helper::ChildConfig::needNew(), statefulhelper::openSessions(), Helper::Client::queue, Helper::Client::_stats::queue_size, Helper::ChildConfig::queue_size, reconfiguring, shutting_down, squid_curtime, and Helper::Client::stats.
Referenced by statefulhelper::submit().
◆ StatefulGetFirstAvailable()
|
static |
Definition at line 1352 of file helper.cc.
References Helper::Client::childs, dlink_node::data, debugs, Helper::SessionBase::flags, dlink_list::head, Helper::SessionBase::index, Helper::ChildConfig::n_running, dlink_node::next, Helper::SessionBase::pending, helper_stateful_server::reservationId, helper_stateful_server::reservationStart, Helper::ChildConfig::reservationTimeout, helper_stateful_server::reserved(), Helper::Client::servers, Helper::SessionBase::_helper_flags::shutdown, squid_curtime, and Helper::SessionBase::stats.
Referenced by helperStatefulKickQueue(), and statefulhelper::submit().
◆ SubmissionFailure()
|
static |
Definition at line 467 of file helper.cc.
References debugs, Helper::Error, and Helper::Unknown.
Referenced by helperSubmit().
Variable Documentation
◆ helperHandleRead
|
static |
Definition at line 44 of file helper.cc.
Referenced by helperHandleRead(), and Helper::Client::openSessions().
◆ helperStatefulHandleRead
|
static |
Definition at line 45 of file helper.cc.
Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().