55 static unsigned int id = 1;
56 debugs(93,7,
"constructed, this=" <<
this <<
" id=" << ++
id);
58 initHTTP(aMethod, aProtocol, aSchemeImg, aUrlpath);
64 debugs(93,7,
"destructed, this=" <<
this);
106#if FOLLOW_X_FORWARDED_FOR
220#if FOLLOW_X_FORWARDED_FOR
274 debugs(58, 3,
"Too large request header (" << hdr_len <<
" bytes)");
284 debugs(73, 3,
"HttpRequest::sanityCheckStartLine: did not find HTTP request method");
302 const char *t = start + strcspn(start,
w_space);
304 start = t + strspn(t,
w_space);
449 debugs(11, 4,
this <<
" to " << peer);
487 bool expectBody =
false;
516 std::unique_ptr<HttpRequest> req(
new HttpRequest(mx));
519 return req.release();
584 debugs(78, 7,
this <<
" " << dns);
621 debugs(73, 3,
static_cast<void*
>(
range) <<
" for " << reason);
711 return Message::parseHeader(hp, clen);
760 const char *cltTag =
"clt_conn_tag";
761 if (
const char *connTag = helperNotes.
findFirst(cltTag)) {
786#if FOLLOW_X_FORWARDED_FOR
791 my_addr = clientConnection->local;
795 const bool proxyProtocolPort =
port ?
port->flags.proxySurrogate :
false;
800 checklist.
syncAle(
this,
nullptr);
816template <
typename Filter>
824template <
typename Filter>
828 return (conn && isGood(conn->
local)) ? &conn->
local :
nullptr;
831template <
typename Filter>
872 return address.
port() > 0;
#define Assure(condition)
#define COMM_INTERCEPTION
const Ip::Address * FindGoodListeningPortAddress(const HttpRequest *callerRequest, const AccessLogEntry *ale, const Filter filter)
void UpdateRequestNotes(ConnStateData *csd, HttpRequest &request, NotePairs const &helperNotes)
static const Ip::Address * FindGoodListeningPortAddressInPort(const AnyP::PortCfgPointer &port, const Filter isGood)
a helper for handling PortCfg cases of FindListeningPortAddress()
AnyP::Port FindListeningPortNumber(const HttpRequest *callerRequest, const AccessLogEntry *ale)
const Ip::Address * FindListeningPortAddress(const HttpRequest *callerRequest, const AccessLogEntry *ale)
void httpRequestPack(void *obj, Packable *p)
static const Ip::Address * FindGoodListeningPortAddressInConn(const Comm::ConnectionPointer &conn, const Filter isGood)
a helper for handling Connection cases of FindListeningPortAddress()
#define SQUIDSBUFPRINT(s)
SBuf StringToSBuf(const String &s)
create a new SBuf from a String by copying contents
char * urlCanonicalCleanWithoutRequest(const SBuf &url, const HttpRequestMethod &method, const AnyP::UriScheme &scheme)
Acl::Answer const & fastCheck()
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
AnyP::PortCfgPointer port
class AccessLogEntry::CacheDetails cache
Comm::ConnectionPointer tcpClient
TCP/IP level details about the client connection.
representation of a class of Size-limit ACLs
collects information about adaptations related to a master transaction
collects information about ICAP processing related to an HTTP transaction
unsigned int major
major version number
unsigned int minor
minor version number
AnyP::UriScheme const & getScheme() const
SBuf & authority(bool requirePort=false) const
void setScheme(const AnyP::ProtocolType &p, const char *str)
convert the URL scheme to that given
SBuf & originForm() const
The RFC 7230 origin-form URI for currently stored values.
bool parse(const HttpRequestMethod &, const SBuf &url)
uint64_t consumedSize() const
struct CachePeer::@20 options
char * domain
Forced domain.
Cbc * valid() const
was set and is valid
Cbc * get() const
a temporary valid raw Cbc pointer or NULL
struct ConnStateData::@29 pinning
bool pinned
this connection was pinned
AnyP::Port port
destination port of the request that caused serverConnection
NotePairs::Pointer notes()
encapsulates DNS lookup results
int wait
msecs spent waiting for the lookup (if any) or -1 (if none)
void clear()
switch to the default "no error information" state
std::vector< HttpHdrRangeSpec * > specs
void HttpRequestMethodXXX(char const *)
const SBuf & image() const
bool respMaybeCacheable() const
Http::MethodType id() const
void recordLookup(const Dns::LookupDetails &detail)
bool conditional() const
has at least one recognized If-* header
CbcPointer< ConnStateData > clientConnectionManager
Adaptation::History::Pointer adaptHistory(bool createIfNone=false) const
Returns possibly nil history, creating it if requested.
MasterXaction::Pointer masterXaction
the master transaction this request belongs to. Never nil.
void clearError()
clear error details, useful for retries/repeats
void prepForDirect()
get ready to be sent directly to an origin server, excluding originserver
void prepForPeering(const CachePeer &peer)
get ready to be sent to the given cache_peer, including originserver
void initHTTP(const HttpRequestMethod &aMethod, AnyP::ProtocolType aProtocol, const char *schemeImage, const char *aUrlpath)
int64_t getRangeOffsetLimit()
HttpRequest * clone() const override
bool inheritProperties(const Http::Message *) override
Ip::Address indirect_client_addr
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
bool parseHeader(Http1::Parser &hp)
void packFirstLineInto(Packable *p, bool full_uri) const override
bool sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *error) override
bool multipartRangeRequest() const
void pack(Packable *p, bool maskSensitiveInfo=false) const
Adaptation::Icap::History::Pointer icapHistory_
per-HTTP transaction info
bool forcedBodyContinuation
whether we have responded with HTTP 100 or FTP 150 already
bool parseFirstLine(const char *start, const char *end) override
NotePairs::Pointer notes()
SBuf vary_headers
The variant second-stage cache key. Generated from Vary header pattern for this request.
String etag
A strong etag of the cached entry. Used for refreshing that entry.
Adaptation::History::Pointer adaptHistory_
per-HTTP transaction info
CbcPointer< Downloader > downloader
The Downloader object which initiated the HTTP request if any.
ConnStateData * pinnedConnection()
int dnsWait
sum of DNS lookup delays in milliseconds, for dt
void ignoreRange(const char *reason)
forgets about the cached Range header (for a reason)
NotePairs::Pointer theNotes
void adaptHistoryImport(const HttpRequest &them)
Makes their history ours, throwing on conflicts.
void swapOut(StoreEntry *e)
void hdrCacheInit() override
char * canonicalCleanUrl() const
Adaptation::History::Pointer adaptLogHistory() const
Returns possibly nil history, creating it if adapt. logging is enabled.
Auth::UserRequest::Pointer auth_user_request
bool expectingBody(const HttpRequestMethod &unused, int64_t &) const override
bool canHandle1xx() const
whether the client is likely to be able to handle a 1xx reply
HttpRequest(const MasterXaction::Pointer &)
static HttpRequest * FromUrl(const SBuf &url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Http::StatusCode checkEntityFraming() const
Error error
the first transaction problem encountered (or falsy)
Adaptation::Icap::History::Pointer icapHistory() const
Returns possibly nil history, creating it if icap logging is enabled.
AnyP::Uri url
the request URI
void manager(const CbcPointer< ConnStateData > &aMgr, const AccessLogEntryPointer &al)
associates the request with a from-client connection manager
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
common parts of HttpRequest and HttpReply
virtual void hdrCacheInit()
uint32_t sources
The message sources.
@ psReadyToParseStartLine
ParseState pstate
the current parsing state
BodyPipe::Pointer body_pipe
optional pipeline to receive message body
HttpHdrCc * cache_control
AnyP::ProtocolVersion http_ver
void setEmpty()
Fast reset of the stored content to what would be after default constructor.
unsigned short port() const
AnyP::PortCfgPointer squidPort
the listening port which originated this transaction
Comm::ConnectionPointer tcpClient
the client TCP connection which originated this transaction
void add(const SBuf &key, const SBuf &value)
void remove(const char *key)
void replaceOrAdd(const NotePairs *src)
const char * findFirst(const char *noteKey) const
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
virtual void append(const char *buf, int size)=0
Appends a c-string to existing packed data.
bool interceptTproxy
Set for requests handled by a "tproxy" port.
RequestFlags cloneAdaptationImmune() const
size_type length() const
Returns the number of bytes stored in SBuf.
Comm::ConnectionPointer clientConnection
acl_access * spoof_client_ip
AclSizeLimit * rangeOffsetLimit
struct SquidConfig::@91 accessList
const char * findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end)
#define debugs(SECTION, LEVEL, CONTENT)
std::optional< KnownPort > Port
validated/supported port number (if any)
@ scInvalidHeader
Squid header parsing error.
AnyP::ProtocolVersion ProtocolVersion()