#include "squid.h"
#include "acl/Checklist.h"
#include "cache_cf.h"
#include "client_side.h"
#include "client_side_reply.h"
#include "client_side_request.h"
#include "comm/Connection.h"
#include "fde.h"
#include "format/Format.h"
#include "globals.h"
#include "helper.h"
#include "helper/Reply.h"
#include "http/Stream.h"
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "redirect.h"
#include "rfc1738.h"
#include "sbuf/SBuf.h"
#include "SquidConfig.h"
#include "Store.h"
#include "auth/UserRequest.h"
#include "ssl/support.h"
Go to the source code of this file.
Classes | |
class | RedirectStateData |
Macros | |
#define | MAX_REDIRECTOR_REQUEST_STRLEN (MAX_URL + 1024) |
url maximum length + extra information passed to redirector More... | |
Functions | |
static void | redirectHandleReply (void *data, const Helper::Reply &reply) |
static void | storeIdHandleReply (void *data, const Helper::Reply &reply) |
static void | redirectStats (StoreEntry *sentry) |
static void | storeIdStats (StoreEntry *sentry) |
static void | constructHelperQuery (const char *const name, const Helper::Client::Pointer &hlp, HLPCB *const replyHandler, ClientHttpRequest *const http, HLPCB *const handler, void *const data, Format::Format *const requestExtrasFmt) |
void | redirectStart (ClientHttpRequest *http, HLPCB *handler, void *data) |
void | storeIdStart (ClientHttpRequest *http, HLPCB *handler, void *data) |
void | redirectInit (void) |
void | redirectShutdown (void) |
void | redirectReconfigure () |
Variables | |
static HLPCB | redirectHandleReply |
static HLPCB | storeIdHandleReply |
static Helper::Client::Pointer | redirectors |
static Helper::Client::Pointer | storeIds |
static OBJH | redirectStats |
static OBJH | storeIdStats |
static int | redirectorBypassed = 0 |
static int | storeIdBypassed = 0 |
static Format::Format * | redirectorExtrasFmt = nullptr |
static Format::Format * | storeIdExtrasFmt = nullptr |
Macro Definition Documentation
◆ MAX_REDIRECTOR_REQUEST_STRLEN
#define MAX_REDIRECTOR_REQUEST_STRLEN (MAX_URL + 1024) |
Definition at line 39 of file redirect.cc.
Function Documentation
◆ constructHelperQuery()
|
static |
TODO: create a standalone method to initialize the RedirectStateData for all the helpers.
Definition at line 226 of file redirect.cc.
References ClientHttpRequest::al, Format::Format::assemble(), assert, HttpRequest::auth_user_request, SBuf::c_str(), cbdataReference, ClientHttpRequest::client_stream, clientStreamRead(), MemBuf::content(), dlink_node::data, RedirectStateData::data, DBG_CRITICAL, debugs, ERR_GATEWAY_FAILURE, ConnStateData::getAuth(), ClientHttpRequest::getConn(), RedirectStateData::handler, handler(), MemBuf::hasContent(), helperSubmit(), MAX_REDIRECTOR_REQUEST_STRLEN, RedirectStateData::orig_url, dlink_node::prev, ClientHttpRequest::request, MemBuf::reset(), Http::scInternalServerError, Http::scUriTooLong, dlink_list::tail, and ClientHttpRequest::uri.
Referenced by redirectStart(), and storeIdStart().
◆ redirectHandleReply()
|
static |
Definition at line 80 of file redirect.cc.
References NotePairs::add(), MemBuf::append(), NotePairs::append(), cbdataReferenceValidDone, MemBuf::content(), MemBuf::contentSize(), RedirectStateData::data, DBG_CRITICAL, DBG_IMPORTANT, debugs, RedirectStateData::handler, MemBuf::hasContent(), MemBuf::init(), Helper::Reply::notes, Helper::Okay, Helper::Reply::other(), Helper::Reply::result, Http::scFound, Http::scMovedPermanently, Http::scPermanentRedirect, Http::scSeeOther, Http::scTemporaryRedirect, Helper::Unknown, and warn().
◆ redirectInit()
void redirectInit | ( | void | ) |
Definition at line 333 of file redirect.cc.
References SquidConfig::UrlHelperTimeout::action, Config, Helper::ChildConfig::defaultQueueSize, IPC_STREAM, Helper::Client::Make(), SquidConfig::onoff, SquidConfig::onUrlRewriteTimeout, Format::Format::parse(), SquidConfig::Program, Helper::ChildConfig::queue_size, SquidConfig::redirect, SquidConfig::redirectChildren, SquidConfig::redirector_bypass, SquidConfig::redirector_extras, redirectorExtrasFmt, redirectors, redirectStats, Mgr::RegisterAction(), SquidConfig::UrlHelperTimeout::response, SquidConfig::store_id, SquidConfig::store_id_bypass, SquidConfig::storeId_extras, SquidConfig::storeIdChildren, storeIdExtrasFmt, storeIds, storeIdStats, SquidConfig::Timeout, toutActRetry, toutActUseConfiguredResponse, and SquidConfig::urlRewrite.
Referenced by mainInitialize(), mainRotate(), and redirectReconfigure().
◆ redirectReconfigure()
void redirectReconfigure | ( | ) |
Definition at line 433 of file redirect.cc.
References redirectInit(), and redirectShutdown().
Referenced by mainReconfigureFinish().
◆ redirectShutdown()
void redirectShutdown | ( | void | ) |
TODO: Temporary unified helpers Shutdown When and if needed for more helpers a separated shutdown method will be added for each of them.
Definition at line 406 of file redirect.cc.
References helperShutdown(), redirectorExtrasFmt, redirectors, shutting_down, storeIdExtrasFmt, and storeIds.
Referenced by mainRotate(), redirectReconfigure(), and SquidShutdown().
◆ redirectStart()
void redirectStart | ( | ClientHttpRequest * | http, |
HLPCB * | handler, | ||
void * | data | ||
) |
Definition at line 285 of file redirect.cc.
References NotePairs::add(), assert, Config, constructHelperQuery(), debugs, handler(), Helper::Reply::notes, Helper::Okay, SquidConfig::onoff, redirectHandleReply, SquidConfig::redirector_bypass, redirectorBypassed, redirectorExtrasFmt, redirectors, Helper::Reply::result, and ClientHttpRequest::uri.
Referenced by clientRedirectAccessCheckDone(), and ClientRequestContext::clientRedirectStart().
◆ redirectStats()
|
static |
Definition at line 196 of file redirect.cc.
References Config, SquidConfig::onoff, SquidConfig::redirector_bypass, redirectorBypassed, redirectors, and storeAppendPrintf().
◆ storeIdHandleReply()
|
static |
Definition at line 180 of file redirect.cc.
References cbdataReferenceValidDone, RedirectStateData::data, debugs, and RedirectStateData::handler.
◆ storeIdStart()
void storeIdStart | ( | ClientHttpRequest * | http, |
HLPCB * | handler, | ||
void * | data | ||
) |
Handles the StoreID feature helper starting. For now it cannot be done using the redirectStart method.
Definition at line 311 of file redirect.cc.
References NotePairs::add(), assert, Config, constructHelperQuery(), debugs, handler(), Helper::Reply::notes, Helper::Okay, SquidConfig::onoff, Helper::Reply::result, SquidConfig::store_id_bypass, storeIdBypassed, storeIdExtrasFmt, storeIdHandleReply, storeIds, and ClientHttpRequest::uri.
Referenced by clientStoreIdAccessCheckDone(), and ClientRequestContext::clientStoreIdStart().
◆ storeIdStats()
|
static |
Definition at line 211 of file redirect.cc.
References Config, SquidConfig::onoff, SquidConfig::store_id_bypass, storeAppendPrintf(), storeIdBypassed, and storeIds.
Variable Documentation
◆ redirectHandleReply
|
static |
Definition at line 55 of file redirect.cc.
Referenced by redirectStart().
◆ redirectorBypassed
|
static |
Definition at line 61 of file redirect.cc.
Referenced by redirectStart(), and redirectStats().
◆ redirectorExtrasFmt
|
static |
Definition at line 63 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), and redirectStart().
◆ redirectors
|
static |
Definition at line 57 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), redirectStart(), and redirectStats().
◆ redirectStats
|
static |
Definition at line 59 of file redirect.cc.
Referenced by redirectInit().
◆ storeIdBypassed
|
static |
Definition at line 62 of file redirect.cc.
Referenced by storeIdStart(), and storeIdStats().
◆ storeIdExtrasFmt
|
static |
Definition at line 64 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), and storeIdStart().
◆ storeIdHandleReply
|
static |
Definition at line 56 of file redirect.cc.
Referenced by storeIdStart().
◆ storeIds
|
static |
Definition at line 58 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), storeIdStart(), and storeIdStats().
◆ storeIdStats
|
static |
Definition at line 60 of file redirect.cc.
Referenced by redirectInit().