#include "squid.h"
#include "acl/FilledChecklist.h"
#include "acl/Gadgets.h"
#include "anyp/PortCfg.h"
#include "base/AsyncJobCalls.h"
#include "client_side.h"
#include "client_side_reply.h"
#include "client_side_request.h"
#include "ClientRequestContext.h"
#include "clientStream.h"
#include "comm/Connection.h"
#include "comm/Write.h"
#include "error/Detail.h"
#include "errorpage.h"
#include "fd.h"
#include "fde.h"
#include "format/Token.h"
#include "gopher.h"
#include "helper.h"
#include "helper/Reply.h"
#include "http.h"
#include "http/Stream.h"
#include "HttpHdrCc.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "ip/NfMarkConfig.h"
#include "ip/QosConfig.h"
#include "ipcache.h"
#include "log/access_log.h"
#include "MemObject.h"
#include "Parsing.h"
#include "profiler/Profiler.h"
#include "proxyp/Header.h"
#include "redirect.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
#include "StrList.h"
#include "tools.h"
#include "wordlist.h"
#include "auth/UserRequest.h"
#include "adaptation/AccessCheck.h"
#include "adaptation/Answer.h"
#include "adaptation/Iterator.h"
#include "adaptation/Service.h"
#include "adaptation/icap/History.h"
#include "ssl/ServerBump.h"
#include "ssl/support.h"

Go to the source code of this file.
Macros | |
#define | FAILURE_MODE_TIME 300 |
Variables | |
static const char *const | crlf = "\r\n" |
static HLPCB | clientRedirectDoneWrapper |
static HLPCB | clientStoreIdDoneWrapper |
SQUIDCEXTERN CSR | clientGetMoreData |
SQUIDCEXTERN CSS | clientReplyStatus |
SQUIDCEXTERN CSD | clientReplyDetach |
Macro Definition Documentation
◆ FAILURE_MODE_TIME
#define FAILURE_MODE_TIME 300 |
Function Documentation
◆ aclFindNfMarkConfig()
Ip::NfMarkConfig aclFindNfMarkConfig | ( | acl_nfmark * | head, |
ACLChecklist * | ch | ||
) |
Definition at line 1428 of file FwdState.cc.
References Acl::Answer::allowed(), ACLChecklist::fastCheck(), head, and squidaio_request_t::next.
Referenced by ClientHttpRequest::doCallouts(), and GetNfmarkToServer().
◆ aclMapTOS()
tos_t aclMapTOS | ( | acl_tos * | head, |
ACLChecklist * | ch | ||
) |
Definition at line 1416 of file FwdState.cc.
References Acl::Answer::allowed(), ACLChecklist::fastCheck(), head, and squidaio_request_t::next.
Referenced by ClientHttpRequest::doCallouts(), and GetTosToServer().
◆ checkFailureRatio()
This function is designed to serve a fairly specific purpose. Occasionally our vBNS-connected caches can talk to each other, but not the rest of the world. Here we try to detect frequent failures which make the cache unusable (e.g. DNS lookup and connect() failures). If the failure:success ratio goes above 1.0 then we go into "hit only" mode where we only return UDP_HIT or UDP_MISS_NOFETCH. Neighbors will only fetch HITs from us if they are using the ICP protocol. We stay in this mode for 5 minutes.
Duane W., Sept 16, 1996
Definition at line 214 of file client_side_request.cc.
References Config, DBG_CRITICAL, debugs, ERR_CONNECT_FAIL, ERR_DNS_FAIL, ERR_READ_ERROR, ERR_SECURE_CONNECT_FAIL, FAILURE_MODE_TIME, HIER_NONE, hit_only_mode_until, SquidConfig::icp, SquidConfig::Port, request_failure_ratio, and squid_curtime.
Referenced by ClientHttpRequest::~ClientHttpRequest().
◆ checkNoCacheDoneWrapper()
|
static |
Definition at line 1372 of file client_side_request.cc.
References ClientRequestContext::checkNoCacheDone(), data, and ClientRequestContext::httpStateIsValid().
Referenced by ClientRequestContext::checkNoCache().
◆ clientAccessCheckDoneWrapper()
|
static |
Definition at line 729 of file client_side_request.cc.
References ClientRequestContext::clientAccessCheckDone(), data, and ClientRequestContext::httpStateIsValid().
Referenced by ClientRequestContext::clientAccessCheck(), and ClientRequestContext::clientAccessCheck2().
◆ clientBeginRequest()
int clientBeginRequest | ( | const HttpRequestMethod & | method, |
char const * | url, | ||
CSCB * | streamcallback, | ||
CSD * | streamdetach, | ||
ClientStreamData | streamdata, | ||
HttpHeader const * | header, | ||
char * | tailbuf, | ||
size_t | taillen, | ||
const MasterXaction::Pointer & | mx | ||
) |
Create a request and kick it off
- Return values
-
0 success -1 failure
TODO: Pass in the buffers to be used in the initial Read request, as they are determined by the user
Definition at line 323 of file client_side_request.cc.
References ClientHttpRequest::Flags::accel, ClientHttpRequest::al, SquidConfig::appendDomainLen, AccessLogEntry::cache, ClientHttpRequest::calloutContext, ClientHttpRequest::client_stream, clientGetMoreData, clientReplyDetach, clientReplyStatus, clientStreamInit(), Config, _request::content_length, current_time, StoreIOBuffer::data, debugs, ClientHttpRequest::doCallouts(), ClientHttpRequest::flags, HttpRequest::FromUrlXXX(), ClientRequestContext::http_access_done, ClientHttpRequest::initRequest(), StoreIOBuffer::length, method, ClientRequestContext::no_cache_done, NULL, Http::ProtocolVersion(), ClientRequestContext::redirect_done, ClientHttpRequest::req_sz, request(), AccessLogEntry::CacheDetails::start_time, ClientHttpRequest::uri, and xcalloc().
Referenced by ESIInclude::Start().
◆ clientBuildError()
ErrorState* clientBuildError | ( | err_type | , |
Http::StatusCode | , | ||
char const * | url, | ||
const ConnStateData * | , | ||
HttpRequest * | , | ||
const AccessLogEntry::Pointer & | |||
) |
Definition at line 2228 of file client_side_reply.cc.
Referenced by ClientHttpRequest::calloutsError(), and ClientRequestContext::clientAccessCheckDone().
◆ clientCheckPinning()
|
static |
Definition at line 966 of file client_side_request.cc.
References assert, ConnStateData::auth, Http::AUTHORIZATION, ClientHttpRequest::getConn(), HttpHeader::getEntry(), HttpHeader::has(), HttpHeaderInitPos, HttpHeaderEntry::id, Comm::IsConnOpen(), ConnStateData::pinning, ConnStateData::port, Http::PROXY_AUTHORIZATION, String::rawBuf(), ClientHttpRequest::request, request(), ConnStateData::serverConnection, and HttpHeaderEntry::value.
Referenced by clientInterpretRequestHeaders().
◆ clientFollowXForwardedForCheck()
|
static |
clientFollowXForwardedForCheck() checks the content of X-Forwarded-For: against the followXFF ACL, or cleans up and passes control to clientAccessCheck().
The trust model here is a little ambiguous. So to clarify the logic:
- we may always use the direct client address as the client IP.
- these trust tests merey tell whether we trust given IP enough to believe the IP string which it appended to the X-Forwarded-For: header.
- if at any point we don't trust what an IP adds we stop looking.
- at that point the current contents of indirect_client_addr are the value set by the last previously trusted IP. ++ indirect_client_addr contains the remote direct client from the trusted peers viewpoint.
Definition at line 439 of file client_side_request.cc.
References SquidConfig::accessList, ClientRequestContext::acl_checklist, SquidConfig::acl_uses_indirect_client, ClientHttpRequest::al, Acl::Answer::allowed(), AccessLogEntry::cache, AccessLogEntry::CacheDetails::caddr, ClientRequestContext::clientAccessCheck(), clientAclChecklistCreate(), Config, Acl::Answer::conflicted(), conn, data, DBG_CRITICAL, debugs, Filled(), SquidConfig::followXFF, ClientHttpRequest::getConn(), ClientRequestContext::http, ClientRequestContext::httpStateIsValid(), SquidConfig::log_uses_indirect_client, ACLChecklist::nonBlockingCheck(), SquidConfig::onoff, ClientHttpRequest::request, request(), ACLFilledChecklist::src_addr, and xisspace.
Referenced by ClientRequestContext::clientAccessCheck().
◆ clientHierarchical()
|
static |
Definition at line 920 of file client_side_request.cc.
References gopherCachable(), method, _request::method, Http::METHOD_GET, Http::METHOD_TRACE, neighbors_do_private_keys, AnyP::PROTO_CACHE_OBJECT, AnyP::PROTO_GOPHER, AnyP::PROTO_HTTP, ClientHttpRequest::request, request(), and _request::url.
Referenced by clientInterpretRequestHeaders().
◆ clientInterpretRequestHeaders()
|
static |
Definition at line 1029 of file client_side_request.cc.
References SquidConfig::Accel, Http::AUTHORIZATION, Http::CDN_LOOP, String::clean(), ClientHttpRequest::client_stream, clientCheckPinning(), clientHierarchical(), Config, dlink_node::data, DBG_IMPORTANT, debugObj(), debugs, HttpHeader::delById(), HttpHdrRangeIter::end, fvdbCountForw(), fvdbCountVia(), HttpHeader::getList(), HttpHeader::getRange(), HttpHeader::getTime(), HttpHeader::has(), HttpHeader::hasListMember(), httpRequestPack(), Http::IF_MODIFIED_SINCE, HttpRequest::maybeCacheable(), _request::method, Http::METHOD_GET, Http::METHOD_HEAD, Http::METHOD_OTHER, SquidConfig::onoff, HttpHdrRangeIter::pos, Http::PRAGMA, Http::RANGE, ClientHttpRequest::range_iter, refresh_nocache_hack, SquidConfig::reload_into_ims, ClientHttpRequest::request, request(), Http::REQUEST_RANGE, strListIsSubstr(), SquidConfig::surrogate_id, dlink_list::tail, String::termedBuf(), ThisCache2, _request::url, HttpHdrRangeIter::valid, Http::VIA, and Http::X_FORWARDED_FOR.
Referenced by ClientHttpRequest::doCallouts().
◆ clientRedirectAccessCheckDone()
|
static |
Definition at line 856 of file client_side_request.cc.
References ClientRequestContext::acl_checklist, Acl::Answer::allowed(), ClientRequestContext::clientRedirectDone(), clientRedirectDoneWrapper, data, Helper::Error, ClientRequestContext::http, NULL, and redirectStart().
Referenced by ClientRequestContext::clientRedirectStart().
◆ clientRedirectDoneWrapper()
void clientRedirectDoneWrapper | ( | void * | data, |
const Helper::Reply & | result | ||
) |
Definition at line 1166 of file client_side_request.cc.
References ClientRequestContext::clientRedirectDone(), data, and ClientRequestContext::httpStateIsValid().
◆ clientStoreIdAccessCheckDone()
|
static |
This methods handles Access checks result of StoreId access list. Will handle as "ERR" (no change) in a case Access is not allowed.
Definition at line 887 of file client_side_request.cc.
References ClientRequestContext::acl_checklist, Acl::Answer::allowed(), ClientRequestContext::clientStoreIdDone(), clientStoreIdDoneWrapper, data, debugs, Helper::Error, ClientRequestContext::http, NULL, and storeIdStart().
Referenced by ClientRequestContext::clientStoreIdStart().
◆ clientStoreIdDoneWrapper()
void clientStoreIdDoneWrapper | ( | void * | data, |
const Helper::Reply & | result | ||
) |
Definition at line 1177 of file client_side_request.cc.
References ClientRequestContext::clientStoreIdDone(), data, and ClientRequestContext::httpStateIsValid().
◆ hostHeaderIpVerifyWrapper()
|
static |
Definition at line 516 of file client_side_request.cc.
References data, and ClientRequestContext::hostHeaderIpVerify().
Referenced by ClientRequestContext::hostHeaderVerify().
◆ sslBumpAccessCheckDoneWrapper()
|
static |
A wrapper function to use the ClientRequestContext::sslBumpAccessCheckDone method as ACLFilledChecklist callback
Definition at line 1470 of file client_side_request.cc.
References data, ClientRequestContext::httpStateIsValid(), and ClientRequestContext::sslBumpAccessCheckDone().
Referenced by ClientRequestContext::sslBumpAccessCheck().
◆ SslBumpEstablish()
|
static |
Definition at line 1559 of file client_side_request.cc.
References assert, cbdataReferenceValid(), data, debugs, HERE(), and ClientHttpRequest::sslBumpEstablish().
Referenced by ClientHttpRequest::sslBumpStart().
Variable Documentation
◆ clientGetMoreData
SQUIDCEXTERN CSR clientGetMoreData |
Definition at line 102 of file client_side_request.cc.
Referenced by clientBeginRequest(), and ClientHttpRequest::handleAdaptedHeader().
◆ clientRedirectDoneWrapper
|
static |
Definition at line 99 of file client_side_request.cc.
Referenced by clientRedirectAccessCheckDone(), and ClientRequestContext::clientRedirectStart().
◆ clientReplyDetach
SQUIDCEXTERN CSD clientReplyDetach |
Definition at line 104 of file client_side_request.cc.
Referenced by clientBeginRequest().
◆ clientReplyStatus
SQUIDCEXTERN CSS clientReplyStatus |
Definition at line 103 of file client_side_request.cc.
Referenced by clientBeginRequest().
◆ clientStoreIdDoneWrapper
|
static |
Definition at line 100 of file client_side_request.cc.
Referenced by clientStoreIdAccessCheckDone(), and ClientRequestContext::clientStoreIdStart().
◆ crlf
|
static |
Definition at line 81 of file client_side_request.cc.