|
Squid Web Cache master
|
#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 "clientStream.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 | |
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 |
| #define MAX_REDIRECTOR_REQUEST_STRLEN (MAX_URL + 1024) |
Definition at line 40 of file redirect.cc.
|
static |
TODO: create a standalone method to initialize the RedirectStateData for all the helpers.
Definition at line 227 of file redirect.cc.
References ClientHttpRequest::al, Format::Format::assemble(), assert, HttpRequest::auth_user_request, cbdataReference, ClientHttpRequest::client_stream, clientStreamRead(), MemBuf::content(), dlink_node::data, DBG_CRITICAL, debugs, ERR_GATEWAY_FAILURE, ConnStateData::getAuth(), ClientHttpRequest::getConn(), MemBuf::hasContent(), helperSubmit(), MAX_REDIRECTOR_REQUEST_STRLEN, dlink_node::prev, ClientHttpRequest::request, MemBuf::reset(), Http::scInternalServerError, Http::scUriTooLong, clientReplyContext::setReplyToError(), dlink_list::tail, ClientHttpRequest::uri, and USE_AUTH.
Referenced by redirectStart(), and storeIdStart().
|
static |
Definition at line 81 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().
| void redirectInit | ( | void | ) |
Definition at line 334 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().
| void redirectReconfigure | ( | ) |
Definition at line 434 of file redirect.cc.
References redirectInit(), and redirectShutdown().
Referenced by mainReconfigureFinish().
| 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 407 of file redirect.cc.
References helperShutdown(), redirectorExtrasFmt, redirectors, shutting_down, storeIdExtrasFmt, and storeIds.
Referenced by mainRotate(), redirectReconfigure(), and SquidShutdown().
| void redirectStart | ( | ClientHttpRequest * | http, |
| HLPCB * | handler, | ||
| void * | data | ||
| ) |
Definition at line 286 of file redirect.cc.
References NotePairs::add(), assert, Config, constructHelperQuery(), debugs, 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().
|
static |
Definition at line 197 of file redirect.cc.
References Config, SquidConfig::onoff, SquidConfig::redirector_bypass, redirectorBypassed, redirectors, and storeAppendPrintf().
|
static |
Definition at line 181 of file redirect.cc.
References cbdataReferenceValidDone, RedirectStateData::data, debugs, and RedirectStateData::handler.
| 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 312 of file redirect.cc.
References NotePairs::add(), assert, Config, constructHelperQuery(), debugs, 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().
|
static |
Definition at line 212 of file redirect.cc.
References Config, SquidConfig::onoff, SquidConfig::store_id_bypass, storeAppendPrintf(), storeIdBypassed, and storeIds.
|
static |
Definition at line 56 of file redirect.cc.
Referenced by redirectStart().
|
static |
Definition at line 62 of file redirect.cc.
Referenced by redirectStart(), and redirectStats().
|
static |
Definition at line 64 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), and redirectStart().
|
static |
Definition at line 58 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), redirectStart(), and redirectStats().
|
static |
Definition at line 60 of file redirect.cc.
Referenced by redirectInit().
|
static |
Definition at line 63 of file redirect.cc.
Referenced by storeIdStart(), and storeIdStats().
|
static |
Definition at line 65 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), and storeIdStart().
|
static |
Definition at line 57 of file redirect.cc.
Referenced by storeIdStart().
|
static |
Definition at line 59 of file redirect.cc.
Referenced by redirectInit(), redirectShutdown(), storeIdStart(), and storeIdStats().
|
static |
Definition at line 61 of file redirect.cc.
Referenced by redirectInit().