http.cc File Reference
#include "squid.h"
#include "acl/FilledChecklist.h"
#include "base/AsyncJobCalls.h"
#include "base/TextException.h"
#include "base64.h"
#include "CachePeer.h"
#include "client_side.h"
#include "comm/Connection.h"
#include "comm/Read.h"
#include "comm/Write.h"
#include "CommRead.h"
#include "err_detail_type.h"
#include "errorpage.h"
#include "fd.h"
#include "fde.h"
#include "globals.h"
#include "http.h"
#include "http/one/ResponseParser.h"
#include "http/one/TeChunkedParser.h"
#include "http/Stream.h"
#include "HttpControlMsg.h"
#include "HttpHdrCc.h"
#include "HttpHdrContRange.h"
#include "HttpHdrSc.h"
#include "HttpHdrScTarget.h"
#include "HttpHeaderTools.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "log/access_log.h"
#include "MemBuf.h"
#include "MemObject.h"
#include "neighbors.h"
#include "peer_proxy_negotiate_auth.h"
#include "profiler/Profiler.h"
#include "refresh.h"
#include "RefreshPattern.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "StatCounters.h"
#include "Store.h"
#include "StrList.h"
#include "tools.h"
#include "URL.h"
#include "util.h"
#include "auth/UserRequest.h"
#include "DelayPools.h"
Include dependency graph for http.cc:

Go to the source code of this file.

Macros

#define SQUID_ENTER_THROWING_CODE()   try {
 
#define SQUID_EXIT_THROWING_CODE(status)
 
#define REFRESH_OVERRIDE(flag)
 
#define BBUF_SZ   (MAX_URL+32)
 

Functions

static void httpMaybeRemovePublic (StoreEntry *, Http::StatusCode)
 
static void copyOneHeaderFromClientsideRequestToUpstreamRequest (const HttpHeaderEntry *e, const String strConnection, const HttpRequest *request, HttpHeader *hdr_out, const int we_do_ranges, const Http::StateFlags &)
 
static StoreEntryfindPreviouslyCachedEntry (StoreEntry *newEntry)
 
static void assembleVaryKey (String &vary, SBuf &vstr, const HttpRequest &request)
 assemble a variant key (vary-mark) from the given Vary header and HTTP request More...
 
SBuf httpMakeVaryMark (HttpRequest *request, HttpReply const *reply)
 
static void readDelayed (void *context, CommRead const &)
 
static void httpFixupAuthentication (HttpRequest *request, const HttpHeader *hdr_in, HttpHeader *hdr_out, const Http::StateFlags &flags)
 
void httpStart (FwdState *fwd)
 
std::ostream & operator<< (std::ostream &os, const HttpStateData::ReuseDecision &d)
 

Variables

static const char *const crlf = "\r\n"
 

Macro Definition Documentation

#define BBUF_SZ   (MAX_URL+32)
#define REFRESH_OVERRIDE (   flag)
Value:
((R = (R ? R : refreshLimits(entry->mem_obj->storeId()))) , \
(R && R->flags.flag))
const RefreshPattern * refreshLimits(const char *url)
Definition: refresh.cc:93

Referenced by HttpStateData::reusableReply().

#define SQUID_ENTER_THROWING_CODE ( )    try {

Definition at line 69 of file http.cc.

Referenced by HttpStateData::decodeAndWriteReplyBody().

#define SQUID_EXIT_THROWING_CODE (   status)
Value:
status = true; \
} \
catch (const std::exception &e) { \
debugs (11, 1, "Exception error:" << e.what()); \
status = false; \
}
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123

Definition at line 70 of file http.cc.

Referenced by HttpStateData::decodeAndWriteReplyBody().

Function Documentation

static void assembleVaryKey ( String vary,
SBuf vstr,
const HttpRequest request 
)
static
void copyOneHeaderFromClientsideRequestToUpstreamRequest ( const HttpHeaderEntry e,
const String  strConnection,
const HttpRequest request,
HttpHeader hdr_out,
const int  we_do_ranges,
const Http::StateFlags flags 
)
static

Decides whether a particular header may be cloned from the received Clients request to our outgoing fetch request.

RFC 2616 sect 13.5.1 - Hop-by-Hop headers which Squid should not pass on.
Proxy-Authorization:
Only pass on proxy authentication to peers for which authentication forwarding is explicitly enabled
RFC 2616 sect 13.5.1 - Hop-by-Hop headers which Squid does not pass on.
Connection:
TE:
Keep-Alive:
Proxy-Authenticate:
Trailer:
Upgrade:
Transfer-Encoding:
OTHER headers I haven't bothered to track down yet.
WWW-Authorization:
Pass on WWW authentication
Note
In accelerators, only forward authentication if enabled (see also httpFixupAuthentication for special cases)
Host:
Normally Squid rewrites the Host: header. However, there is one case when we don't: If the URL went through our redirector and the admin configured 'redir_rewrites_host' to be off.
If-Modified-Since:
append unless we added our own, but only if cache_miss_revalidate is enabled, or the request is not cacheable, or the request contains authentication credentials.
Note
at most one client's If-Modified-Since header can pass through
If-None-Match:
append if the wildcard '*' special case value is present, or cache_miss_revalidate is disabled, or the request is not cacheable in this proxy, or the request contains authentication credentials.
Note
this header lists a set of responses for the server to elide sending. Squid added values are extending that set.
Max-Forwards:
pass only on TRACE or OPTIONS requests
Via:
If Via is disabled then forward any received header as-is. Otherwise leave for explicit updated addition later.
Range:, If-Range:, Request-Range:
Only pass if we accept ranges
X-Forwarded-For:, Cache-Control:
handled specially by Squid, so leave off for now. append these after the loop if needed
Front-End-Https:
Pass thru only if peer is configured with front-end-https
default.
pass on all other header fields which are NOT listed by the special Connection: header.

Definition at line 1931 of file http.cc.

References HttpHeader::addEntry(), RequestFlags::auth, URL::authority(), Http::AUTHORIZATION, SBuf::c_str(), RequestFlags::cachable, Http::CACHE_CONTROL, SquidConfig::cache_miss_revalidate, Http::StateFlags::chunked_request, HttpHeaderEntry::clone(), Config, Http::CONNECTION, Http::CONTENT_LENGTH, debugs, HttpRequest::flags, Http::StateFlags::front_end_https, Http::FRONT_END_HTTPS, HttpHeaderEntry::getInt64(), HttpHeader::has(), HttpHeader::hasListMember(), Http::HOST, HttpHeaderEntry::id, Http::IF_MATCH, Http::IF_MODIFIED_SINCE, Http::IF_NONE_MATCH, Http::IF_RANGE, Http::KEEP_ALIVE, Http::MAX_FORWARDS, HttpRequest::method, Http::METHOD_OPTIONS, Http::METHOD_TRACE, HttpHeaderEntry::name, SquidConfig::onoff, Http::StateFlags::originpeer, HttpRequest::peer_domain, HttpRequest::peer_login, Http::PROXY_AUTHENTICATE, Http::PROXY_AUTHORIZATION, Http::PROXY_CONNECTION, Http::StateFlags::proxying, HttpHeader::putInt64(), HttpHeader::putStr(), Http::RANGE, SquidConfig::redir_rewrites_host, RequestFlags::redirected, Http::REQUEST_RANGE, String::size(), strListIsMember(), Http::TE, Http::TRAILER, Http::TRANSFER_ENCODING, Http::UPGRADE, HttpRequest::url, HttpHeaderEntry::value, Http::VIA, SquidConfig::via, and Http::X_FORWARDED_FOR.

Referenced by HttpStateData::httpBuildRequestHeader().

void httpStart ( FwdState fwd)
static void readDelayed ( void *  context,
CommRead const &   
)
static

Variable Documentation

const char* const crlf = "\r\n"
static

Definition at line 80 of file http.cc.

Referenced by HttpStateData::buildRequestPrefix().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors