HttpRequest.cc
Go to the documentation of this file.
50HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aSchemeImg, const char *aUrlpath, const MasterXaction::Pointer &mx) :
68HttpRequest::initHTTP(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aSchemeImg, const char *aUrlpath)
268HttpRequest::sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *scode)
517HttpRequest::FromUrl(const SBuf &url, const MasterXaction::Pointer &mx, const HttpRequestMethod& method)
528HttpRequest::FromUrlXXX(const char * url, const MasterXaction::Pointer &mx, const HttpRequestMethod& method)
543 // TODO: update cache to store for particular clients only (going to same Host: and destination IP)
801 ACLFilledChecklist *checklist = new ACLFilledChecklist(Config.accessList.spoof_client_ip, this, clientConnection->rfc931);
837FindGoodListeningPortAddress(const HttpRequest *callerRequest, const AccessLogEntry *ale, const Filter filter)
875 const auto ip = FindGoodListeningPortAddress(callerRequest, ale, [](const Ip::Address &address) {
const Ip::Address * FindGoodListeningPortAddress(const HttpRequest *callerRequest, const AccessLogEntry *ale, const Filter filter)
Definition: HttpRequest.cc:837
void UpdateRequestNotes(ConnStateData *csd, HttpRequest &request, NotePairs const &helperNotes)
Definition: HttpRequest.cc:760
static const Ip::Address * FindGoodListeningPortAddressInPort(const AnyP::PortCfgPointer &port, const Filter isGood)
a helper for handling PortCfg cases of FindListeningPortAddress()
Definition: HttpRequest.cc:822
AnyP::Port FindListeningPortNumber(const HttpRequest *callerRequest, const AccessLogEntry *ale)
Definition: HttpRequest.cc:873
const Ip::Address * FindListeningPortAddress(const HttpRequest *callerRequest, const AccessLogEntry *ale)
Definition: HttpRequest.cc:864
static const Ip::Address * FindGoodListeningPortAddressInConn(const Comm::ConnectionPointer &conn, const Filter isGood)
a helper for handling Connection cases of FindListeningPortAddress()
Definition: HttpRequest.cc:830
SBuf StringToSBuf(const String &s)
create a new SBuf from a String by copying contents
Definition: StringConvert.h:17
char * urlCanonicalCleanWithoutRequest(const SBuf &url, const HttpRequestMethod &method, const AnyP::UriScheme &scheme)
Definition: Uri.cc:704
Definition: FilledChecklist.h:32
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
Definition: FilledChecklist.h:101
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
Definition: FilledChecklist.cc:121
Definition: AccessLogEntry.h:41
class AccessLogEntry::CacheDetails cache
Comm::ConnectionPointer tcpClient
TCP/IP level details about the client connection.
Definition: AccessLogEntry.h:83
collects information about adaptations related to a master transaction
Definition: History.h:25
collects information about ICAP processing related to an HTTP transaction
Definition: History.h:24
void setScheme(const AnyP::ProtocolType &p, const char *str)
convert the URL scheme to that given
Definition: Uri.h:70
Definition: CachePeer.h:31
struct CachePeer::@28 options
Definition: client_side.h:84
struct ConnStateData::@37 pinning
AnyP::Port port
destination port of the request that caused serverConnection
Definition: client_side.h:145
bool unsupportedTe() const
whether message used an unsupported and/or invalid Transfer-Encoding
Definition: HttpHeader.h:172
int parse(const char *header_start, size_t len, Http::ContentLengthInterpreter &interpreter)
Definition: HttpHeader.cc:350
bool conflictingContentLength() const
Definition: HttpHeader.h:113
void packInto(Packable *p, bool mask_sensitive_info=false) const
Definition: HttpHeader.cc:540
Definition: RequestMethod.h:27
void HttpRequestMethodXXX(char const *)
Definition: RequestMethod.cc:31
bool respMaybeCacheable() const
Definition: RequestMethod.cc:208
Definition: HttpRequest.h:49
void recordLookup(const Dns::LookupDetails &detail)
Definition: HttpRequest.cc:580
CbcPointer< ConnStateData > clientConnectionManager
Definition: HttpRequest.h:232
Adaptation::History::Pointer adaptHistory(bool createIfNone=false) const
Returns possibly nil history, creating it if requested.
Definition: HttpRequest.cc:404
MasterXaction::Pointer masterXaction
the master transaction this request belongs to. Never nil.
Definition: HttpRequest.h:238
void prepForDirect()
get ready to be sent directly to an origin server, excluding originserver
Definition: HttpRequest.cc:456
void prepForPeering(const CachePeer &peer)
get ready to be sent to the given cache_peer, including originserver
Definition: HttpRequest.cc:446
void initHTTP(const HttpRequestMethod &aMethod, AnyP::ProtocolType aProtocol, const char *schemeImage, const char *aUrlpath)
Definition: HttpRequest.cc:68
bool inheritProperties(const Http::Message *) override
Definition: HttpRequest.cc:214
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Definition: HttpRequest.cc:528
void packFirstLineInto(Packable *p, bool full_uri) const override
Definition: HttpRequest.cc:472
bool sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *error) override
Definition: HttpRequest.cc:268
Adaptation::Icap::History::Pointer icapHistory_
per-HTTP transaction info
Definition: HttpRequest.h:122
bool forcedBodyContinuation
whether we have responded with HTTP 100 or FTP 150 already
Definition: HttpRequest.h:194
bool parseFirstLine(const char *start, const char *end) override
Definition: HttpRequest.cc:294
SBuf vary_headers
The variant second-stage cache key. Generated from Vary header pattern for this request.
Definition: HttpRequest.h:170
String etag
A strong etag of the cached entry. Used for refreshing that entry.
Definition: HttpRequest.h:191
CbcPointer< Downloader > downloader
The Downloader object which initiated the HTTP request if any.
Definition: HttpRequest.h:235
void ignoreRange(const char *reason)
forgets about the cached Range header (for a reason)
Definition: HttpRequest.cc:621
void adaptHistoryImport(const HttpRequest &them)
Makes their history ours, throwing on conflicts.
Definition: HttpRequest.cc:421
Adaptation::History::Pointer adaptLogHistory() const
Returns possibly nil history, creating it if adapt. logging is enabled.
Definition: HttpRequest.cc:415
Auth::UserRequest::Pointer auth_user_request
Definition: HttpRequest.h:127
bool expectingBody(const HttpRequestMethod &unused, int64_t &) const override
Definition: HttpRequest.cc:488
bool canHandle1xx() const
whether the client is likely to be able to handle a 1xx reply
Definition: HttpRequest.cc:635
static HttpRequest * FromUrl(const SBuf &url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Definition: HttpRequest.cc:517
Http::StatusCode checkEntityFraming() const
Definition: HttpRequest.cc:647
Adaptation::Icap::History::Pointer icapHistory() const
Returns possibly nil history, creating it if icap logging is enabled.
Definition: HttpRequest.cc:389
void manager(const CbcPointer< ConnStateData > &aMgr, const AccessLogEntryPointer &al)
associates the request with a from-client connection manager
Definition: HttpRequest.cc:774
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
Definition: HttpRequest.cc:744
Definition: Parser.h:41
Definition: Address.h:41
void setEmpty()
Fast reset of the stored content to what would be after default constructor.
Definition: Address.cc:184
AnyP::PortCfgPointer squidPort
the listening port which originated this transaction
Definition: MasterXaction.h:63
Comm::ConnectionPointer tcpClient
the client TCP connection which originated this transaction
Definition: MasterXaction.h:66
Definition: Notes.h:173
Definition: Packable.h:53
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
Definition: Packable.h:61
virtual void append(const char *buf, int size)=0
Appends a c-string to existing packed data.
Definition: RequestFlags.h:23
RequestFlags cloneAdaptationImmune() const
Definition: RequestFlags.cc:21
struct SquidConfig::@107 accessList
Definition: Store.h:42
const char * findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end)
Definition: client_side.cc:1076
const char * null_string
Definition: forward.h:18
AnyP::ProtocolVersion ProtocolVersion(unsigned int aMajor, unsigned int aMinor)
HTTP version label information.
Definition: ProtocolVersion.h:19