#include <ClientRequestContext.h>
Public Member Functions | |
void * | operator new (size_t size) |
void | operator delete (void *address) |
void * | toCbdata () noexcept |
ClientRequestContext (ClientHttpRequest *) | |
~ClientRequestContext () override | |
bool | httpStateIsValid () |
void | hostHeaderVerify () |
void | hostHeaderIpVerify (const ipcache_addrs *, const Dns::LookupDetails &) |
void | hostHeaderVerifyFailed (const char *A, const char *B) |
void | clientAccessCheck () |
void | clientAccessCheck2 () |
void | clientAccessCheckDone (const Acl::Answer &) |
void | clientRedirectStart () |
void | clientRedirectDone (const Helper::Reply &) |
void | clientStoreIdStart () |
void | clientStoreIdDone (const Helper::Reply &) |
void | checkNoCache () |
applies "cache allow/deny" rules, asynchronously if needed More... | |
void | checkNoCacheDone (const Acl::Answer &) |
void | adaptationAccessCheck () |
bool | sslBumpAccessCheck () |
void | sslBumpAccessCheckDone (const Acl::Answer &answer) |
The callback function for ssl-bump access check list. More... | |
Public Attributes | |
ClientHttpRequest * | http |
ACLChecklist * | acl_checklist = nullptr |
need ptr back so we can unregister if needed More... | |
int | redirect_state = REDIRECT_NONE |
int | store_id_state = REDIRECT_NONE |
bool | host_header_verify_done = false |
bool | http_access_done = false |
bool | adapted_http_access_done = false |
bool | adaptation_acl_check_done = false |
bool | redirect_done = false |
bool | store_id_done = false |
bool | no_cache_done = false |
bool | interpreted_req_hdrs = false |
bool | toClientMarkingDone = false |
bool | sslBumpCheckDone = false |
ErrorState * | error = nullptr |
saved error page for centralized/delayed processing More... | |
bool | readNextRequest = false |
whether Squid should read after error handling More... | |
Static Private Attributes | |
static cbdata_type | CBDATA_ClientRequestContext = CBDATA_UNKNOWN |
Detailed Description
Definition at line 28 of file ClientRequestContext.h.
Constructor & Destructor Documentation
◆ ClientRequestContext()
ClientRequestContext::ClientRequestContext | ( | ClientHttpRequest * | anHttp | ) |
Definition at line 115 of file client_side_request.cc.
References debugs.
◆ ~ClientRequestContext()
|
override |
Definition at line 101 of file client_side_request.cc.
References cbdataReferenceDone, debugs, error, and http.
Member Function Documentation
◆ adaptationAccessCheck()
void ClientRequestContext::adaptationAccessCheck | ( | ) |
◆ checkNoCache()
void ClientRequestContext::checkNoCache | ( | ) |
Definition at line 1310 of file client_side_request.cc.
References ACCESS_ALLOWED, SquidConfig::accessList, acl_checklist, checkNoCacheDone(), checkNoCacheDoneWrapper(), clientAclChecklistCreate(), Config, http, SquidConfig::noCache, and ACLChecklist::nonBlockingCheck().
Referenced by ClientHttpRequest::doCallouts().
◆ checkNoCacheDone()
void ClientRequestContext::checkNoCacheDone | ( | const Acl::Answer & | answer | ) |
Definition at line 1333 of file client_side_request.cc.
References acl_checklist, Acl::Answer::denied(), RequestFlags::disableCacheUse(), ClientHttpRequest::doCallouts(), HttpRequest::flags, http, and ClientHttpRequest::request.
Referenced by checkNoCache(), and checkNoCacheDoneWrapper().
◆ clientAccessCheck()
void ClientRequestContext::clientAccessCheck | ( | ) |
Definition at line 642 of file client_side_request.cc.
References ACCESS_DENIED, SquidConfig::accessList, acl_checklist, HttpRequest::client_addr, clientAccessCheckDone(), clientAccessCheckDoneWrapper(), clientAclChecklistCreate(), clientFollowXForwardedForCheck(), Config, DBG_CRITICAL, debugs, RequestFlags::doneFollowXff(), HttpRequest::flags, SquidConfig::followXFF, HttpHeader::getList(), HttpHeader::has(), Http::Message::header, http, SquidConfig::http, HttpRequest::indirect_client_addr, ACLChecklist::nonBlockingCheck(), Ip::Address::port(), ClientHttpRequest::request, Http::X_FORWARDED_FOR, and HttpRequest::x_forwarded_for_iterator.
Referenced by clientFollowXForwardedForCheck(), and ClientHttpRequest::doCallouts().
◆ clientAccessCheck2()
void ClientRequestContext::clientAccessCheck2 | ( | ) |
Identical in operation to clientAccessCheck() but performed later using different configured ACL list. The default here is to allow all. Since the earlier http_access should do a default deny all. This check is just for a last-minute denial based on adapted request headers.
Definition at line 678 of file client_side_request.cc.
References ACCESS_ALLOWED, SquidConfig::accessList, acl_checklist, SquidConfig::adapted_http, clientAccessCheckDone(), clientAccessCheckDoneWrapper(), clientAclChecklistCreate(), Config, debugs, http, and ACLChecklist::nonBlockingCheck().
Referenced by ClientHttpRequest::doCallouts().
◆ clientAccessCheckDone()
void ClientRequestContext::clientAccessCheckDone | ( | const Acl::Answer & | answer | ) |
Definition at line 701 of file client_side_request.cc.
References ClientHttpRequest::Flags::accel, ACCESS_AUTH_REQUIRED, acl_checklist, aclGetDenyInfoPage(), aclIsProxyAuth(), AclMatchedName, ClientHttpRequest::al, Acl::Answer::allowed(), ErrorState::auth_user_request, HttpRequest::auth_user_request, clientBuildError(), Config, debugs, SquidConfig::denyInfoList, Auth::UserRequest::denyMessage(), ClientHttpRequest::doCallouts(), HttpRequest::effectiveRequestUri(), ERR_ACCESS_DENIED, ERR_CACHE_ACCESS_DENIED, ERR_NONE, error, ClientHttpRequest::flags, HttpRequest::flags, ConnStateData::getAuth(), ClientHttpRequest::getConn(), http, LOG_TCP_DENIED, HttpRequest::method, readNextRequest, ClientHttpRequest::request, SBufToCstring(), Http::scForbidden, Http::scProxyAuthenticationRequired, Http::scUnauthorized, RequestFlags::sslBumped, ClientHttpRequest::updateLoggingTags(), ClientHttpRequest::uri, and xfree.
Referenced by clientAccessCheck(), clientAccessCheck2(), clientAccessCheckDoneWrapper(), and ClientHttpRequest::handleAdaptationBlock().
◆ clientRedirectDone()
void ClientRequestContext::clientRedirectDone | ( | const Helper::Reply & | reply | ) |
Definition at line 1143 of file client_side_request.cc.
References SquidConfig::UrlHelperTimeout::action, ClientHttpRequest::al, assert, Http::Message::body_pipe, Helper::BrokenHelper, ClientHttpRequest::calloutsError(), Server::clientConnection, HttpRequest::clone(), Config, DBG_CRITICAL, DBG_IMPORTANT, debugs, ClientHttpRequest::doCallouts(), HttpRequest::effectiveRequestUri(), ERR_GATEWAY_FAILURE, Helper::Error, Comm::Connection::fd, fd_note(), NotePairs::findFirst(), ClientHttpRequest::getConn(), http, Http::Message::http_ver, Comm::IsConnOpen(), ClientHttpRequest::Redirect::location, MakeNamedErrorDetail(), HttpRequest::method, Helper::Reply::notes, Helper::Okay, SquidConfig::onUrlRewriteTimeout, AnyP::Uri::parse(), ClientHttpRequest::redirect, REDIRECT_DONE, REDIRECT_PENDING, redirect_state, ClientHttpRequest::request, ClientHttpRequest::resetRequestXXX(), Helper::Reply::result, Http::scFound, Http::scMovedPermanently, Http::scPermanentRedirect, Http::scSeeOther, Http::scTemporaryRedirect, ClientHttpRequest::Redirect::status, AccessLogEntry::syncNotes(), Helper::TimedOut, toutActBypass, Helper::TT, Helper::Unknown, UpdateRequestNotes(), ClientHttpRequest::uri, HttpRequest::url, and xstrdup.
Referenced by clientRedirectAccessCheckDone(), and clientRedirectDoneWrapper().
◆ clientRedirectStart()
void ClientRequestContext::clientRedirectStart | ( | ) |
Definition at line 832 of file client_side_request.cc.
References SquidConfig::accessList, acl_checklist, ClientHttpRequest::al, clientAclChecklistCreate(), clientRedirectAccessCheckDone(), clientRedirectDoneWrapper, Config, debugs, http, ACLChecklist::nonBlockingCheck(), SquidConfig::redirector, redirectStart(), ClientHttpRequest::request, AccessLogEntry::syncNotes(), and ClientHttpRequest::uri.
Referenced by ClientHttpRequest::doCallouts().
◆ clientStoreIdDone()
void ClientRequestContext::clientStoreIdDone | ( | const Helper::Reply & | reply | ) |
This method handles the different replies from StoreID helper.
Definition at line 1259 of file client_side_request.cc.
References ClientHttpRequest::al, assert, Helper::BrokenHelper, DBG_IMPORTANT, debugs, ClientHttpRequest::doCallouts(), Helper::Error, NotePairs::findFirst(), ClientHttpRequest::getConn(), http, Helper::Reply::notes, Helper::Okay, REDIRECT_DONE, REDIRECT_PENDING, ClientHttpRequest::request, Helper::Reply::result, ClientHttpRequest::store_id, HttpRequest::store_id, store_id_state, AccessLogEntry::syncNotes(), Helper::TimedOut, Helper::TT, Helper::Unknown, UpdateRequestNotes(), and ClientHttpRequest::uri.
Referenced by clientStoreIdAccessCheckDone(), and clientStoreIdDoneWrapper().
◆ clientStoreIdStart()
void ClientRequestContext::clientStoreIdStart | ( | ) |
Start locating an alternative storage ID string (if any) from admin configured helper program. This is an asynchronous operation terminating in ClientRequestContext::clientStoreIdDone() when completed.
Definition at line 869 of file client_side_request.cc.
References SquidConfig::accessList, acl_checklist, clientAclChecklistCreate(), clientStoreIdAccessCheckDone(), clientStoreIdDoneWrapper, Config, debugs, http, ACLChecklist::nonBlockingCheck(), SquidConfig::store_id, storeIdStart(), and ClientHttpRequest::uri.
Referenced by ClientHttpRequest::doCallouts().
◆ hostHeaderIpVerify()
void ClientRequestContext::hostHeaderIpVerify | ( | const ipcache_addrs * | ia, |
const Dns::LookupDetails & | dns | ||
) |
Definition at line 477 of file client_side_request.cc.
References Server::clientConnection, debugs, ClientHttpRequest::doCallouts(), HttpRequest::flags, ClientHttpRequest::getConn(), Dns::CachedIps::have(), hostHeaderVerifyFailed(), RequestFlags::hostVerified, http, Comm::Connection::local, HttpRequest::recordLookup(), and ClientHttpRequest::request.
Referenced by hostHeaderIpVerifyWrapper().
◆ hostHeaderVerify()
void ClientRequestContext::hostHeaderVerify | ( | ) |
Definition at line 543 of file client_side_request.cc.
References Server::clientConnection, Config, debugs, AnyP::UriScheme::defaultPort(), ClientHttpRequest::doCallouts(), HttpRequest::flags, ClientHttpRequest::getConn(), AnyP::Uri::getScheme(), HttpHeader::getStr(), Http::Message::header, AnyP::Uri::host(), Http::HOST, hostHeaderIpVerifyWrapper(), hostHeaderVerifyFailed(), SquidConfig::hostStrictVerify, RequestFlags::hostVerified, http, RequestFlags::intercepted, RequestFlags::interceptTproxy, RequestFlags::internal, ipcache_nbgethostbyname(), Comm::Connection::local, matchDomainName(), HttpRequest::method, Http::METHOD_CONNECT, SquidConfig::onoff, port, Ip::Address::port(), AnyP::Uri::port(), ClientHttpRequest::request, safe_free, strtoll(), HttpRequest::url, and xstrdup.
Referenced by ClientHttpRequest::doCallouts().
◆ hostHeaderVerifyFailed()
void ClientRequestContext::hostHeaderVerifyFailed | ( | const char * | A, |
const char * | B | ||
) |
Definition at line 496 of file client_side_request.cc.
References A, assert, HttpRequest::auth_user_request, B, RequestFlags::cachable, ClientHttpRequest::client_stream, Server::clientConnection, clientStreamRead(), Config, dlink_node::data, DBG_IMPORTANT, debugs, ClientHttpRequest::doCallouts(), HttpRequest::effectiveRequestUri(), ERR_CONFLICT_HOST, HttpRequest::flags, ConnStateData::getAuth(), ClientHttpRequest::getConn(), HttpHeader::getStr(), Http::Message::header, RequestFlags::hierarchical, SquidConfig::hostStrictVerify, http, HttpRequest::method, Http::METHOD_CONNECT, SquidConfig::onoff, dlink_node::prev, ClientHttpRequest::request, Http::scConflict, dlink_list::tail, Http::USER_AGENT, and SupportOrVeto::veto().
Referenced by hostHeaderIpVerify(), and hostHeaderVerify().
◆ httpStateIsValid()
bool ClientRequestContext::httpStateIsValid | ( | ) |
Definition at line 363 of file client_side_request.cc.
References cbdataReferenceDone, cbdataReferenceValid(), and http.
Referenced by checkNoCacheDoneWrapper(), clientAccessCheckDoneWrapper(), clientFollowXForwardedForCheck(), clientRedirectDoneWrapper(), clientStoreIdDoneWrapper(), sslBumpAccessCheckDone(), and sslBumpAccessCheckDoneWrapper().
◆ operator delete()
|
inline |
Definition at line 30 of file ClientRequestContext.h.
◆ operator new()
|
inline |
Definition at line 30 of file ClientRequestContext.h.
◆ sslBumpAccessCheck()
bool ClientRequestContext::sslBumpAccessCheck | ( | ) |
Initiates and start the acl checklist to check if the CONNECT request must be bumped.
- Return values
-
true if the acl check scheduled false if no ssl-bump required
Definition at line 1344 of file client_side_request.cc.
References SquidConfig::accessList, ClientHttpRequest::al, Ssl::bumpBump, Ssl::bumpEnd, AccessLogEntry::SslDetails::bumpMode, Ssl::bumpMode(), clientAclChecklistCreate(), Config, debugs, error, errorTypeName(), HttpRequest::flags, RequestFlags::forceTunnel, ClientHttpRequest::getConn(), http, ErrorState::httpStatus, HttpRequest::method, Http::METHOD_CONNECT, ACLChecklist::nonBlockingCheck(), ConnStateData::port, ClientHttpRequest::redirect, ClientHttpRequest::request, Http::scProxyAuthenticationRequired, ConnStateData::serverBump(), AccessLogEntry::ssl, SquidConfig::ssl_bump, sslBumpAccessCheckDoneWrapper(), ConnStateData::sslBumpMode, ClientHttpRequest::sslBumpNeed(), ClientHttpRequest::Redirect::status, ConnStateData::switchedToHttps(), and ErrorState::type.
Referenced by ClientHttpRequest::doCallouts().
◆ sslBumpAccessCheckDone()
void ClientRequestContext::sslBumpAccessCheckDone | ( | const Acl::Answer & | answer | ) |
Definition at line 1429 of file client_side_request.cc.
References ClientHttpRequest::al, Acl::Answer::allowed(), AccessLogEntry::SslDetails::bumpMode, Ssl::bumpMode(), Ssl::bumpSplice, Ssl::bumpTerminate, Server::clientConnection, Comm::Connection::close(), debugs, ClientHttpRequest::doCallouts(), ClientHttpRequest::getConn(), http, httpStateIsValid(), Comm::IsConnOpen(), Acl::Answer::kind, AccessLogEntry::ssl, and ClientHttpRequest::sslBumpNeed().
Referenced by sslBumpAccessCheckDoneWrapper().
◆ toCbdata()
|
inlinenoexcept |
Definition at line 30 of file ClientRequestContext.h.
Member Data Documentation
◆ acl_checklist
ACLChecklist* ClientRequestContext::acl_checklist = nullptr |
Definition at line 65 of file ClientRequestContext.h.
Referenced by checkNoCache(), checkNoCacheDone(), clientAccessCheck(), clientAccessCheck2(), clientAccessCheckDone(), clientFollowXForwardedForCheck(), clientRedirectAccessCheckDone(), clientRedirectStart(), clientStoreIdAccessCheckDone(), and clientStoreIdStart().
◆ adaptation_acl_check_done
bool ClientRequestContext::adaptation_acl_check_done = false |
Definition at line 73 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ adapted_http_access_done
bool ClientRequestContext::adapted_http_access_done = false |
Definition at line 71 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ CBDATA_ClientRequestContext
|
staticprivate |
Definition at line 30 of file ClientRequestContext.h.
◆ error
ErrorState* ClientRequestContext::error = nullptr |
Definition at line 83 of file ClientRequestContext.h.
Referenced by ~ClientRequestContext(), ClientHttpRequest::calloutsError(), clientAccessCheckDone(), ClientHttpRequest::doCallouts(), and sslBumpAccessCheck().
◆ host_header_verify_done
bool ClientRequestContext::host_header_verify_done = false |
Definition at line 69 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ http
ClientHttpRequest* ClientRequestContext::http |
Definition at line 64 of file ClientRequestContext.h.
Referenced by ~ClientRequestContext(), checkNoCache(), checkNoCacheDone(), clientAccessCheck(), clientAccessCheck2(), clientAccessCheckDone(), clientFollowXForwardedForCheck(), clientRedirectAccessCheckDone(), clientRedirectDone(), clientRedirectStart(), clientStoreIdAccessCheckDone(), clientStoreIdDone(), clientStoreIdStart(), ClientHttpRequest::doCallouts(), hostHeaderIpVerify(), hostHeaderVerify(), hostHeaderVerifyFailed(), httpStateIsValid(), sslBumpAccessCheck(), and sslBumpAccessCheckDone().
◆ http_access_done
bool ClientRequestContext::http_access_done = false |
Definition at line 70 of file ClientRequestContext.h.
Referenced by clientBeginRequest(), and ClientHttpRequest::doCallouts().
◆ interpreted_req_hdrs
bool ClientRequestContext::interpreted_req_hdrs = false |
Definition at line 78 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ no_cache_done
bool ClientRequestContext::no_cache_done = false |
Definition at line 77 of file ClientRequestContext.h.
Referenced by clientBeginRequest(), and ClientHttpRequest::doCallouts().
◆ readNextRequest
bool ClientRequestContext::readNextRequest = false |
Definition at line 84 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::calloutsError(), clientAccessCheckDone(), and ClientHttpRequest::doCallouts().
◆ redirect_done
bool ClientRequestContext::redirect_done = false |
Definition at line 75 of file ClientRequestContext.h.
Referenced by clientBeginRequest(), and ClientHttpRequest::doCallouts().
◆ redirect_state
int ClientRequestContext::redirect_state = REDIRECT_NONE |
Definition at line 66 of file ClientRequestContext.h.
Referenced by clientRedirectDone(), and ClientHttpRequest::doCallouts().
◆ sslBumpCheckDone
bool ClientRequestContext::sslBumpCheckDone = false |
Definition at line 81 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ store_id_done
bool ClientRequestContext::store_id_done = false |
Definition at line 76 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
◆ store_id_state
int ClientRequestContext::store_id_state = REDIRECT_NONE |
Definition at line 67 of file ClientRequestContext.h.
Referenced by clientStoreIdDone(), and ClientHttpRequest::doCallouts().
◆ toClientMarkingDone
bool ClientRequestContext::toClientMarkingDone = false |
Definition at line 79 of file ClientRequestContext.h.
Referenced by ClientHttpRequest::doCallouts().
The documentation for this class was generated from the following files: