<p>The most important of these new features are:
<itemize>
+ <item>removed support for the cache_object URI scheme
<item>Cache Manager changes
</itemize>
<p>
<descrip>
+ <tag>cache_object URI</tag>
+ <p>Cache manager is no longer accessible by URIs with cache_object scheme.
+
<tag>non_peers</tag>
<p>Removed the <em>mgr:non_peers</em> report. Squid still ignores
unexpected ICP responses but no longer remembers the details that comprised
* be allowed. yuck, I know.
*/
- if ( Config.accessList.miss && !request->client_addr.isNoAddr() &&
- !request->flags.internal && request->url.getScheme() != AnyP::PROTO_CACHE_OBJECT) {
+ if ( Config.accessList.miss && !request->client_addr.isNoAddr() && !request->flags.internal) {
/**
* Check if this host is allowed to fetch MISSES from us (miss_access).
* Intentionally replace the src_addr automatically selected by the checklist code
switch (request->url.getScheme()) {
- case AnyP::PROTO_CACHE_OBJECT:
- debugs(17, 2, "calling CacheManager due to request scheme " << request->url.getScheme());
- CacheManager::GetInstance()->start(clientConn, request, entry, al);
- return;
-
case AnyP::PROTO_URN:
urnStart(request, entry, al);
return;
Ftp::StartGateway(this);
break;
- case AnyP::PROTO_CACHE_OBJECT:
-
case AnyP::PROTO_URN:
fatal_dump("Should never get here");
break;
return false;
break;
- case AnyP::PROTO_CACHE_OBJECT:
- return false;
-
//case AnyP::PROTO_FTP:
default:
break;
#include "MasterXaction.h"
const libecap::Name Adaptation::Ecap::protocolInternal("internal", libecap::Name::NextId());
-const libecap::Name Adaptation::Ecap::protocolCacheObj("cache_object", libecap::Name::NextId());
const libecap::Name Adaptation::Ecap::protocolIcp("ICP", libecap::Name::NextId());
#if USE_HTCP
const libecap::Name Adaptation::Ecap::protocolHtcp("Htcp", libecap::Name::NextId());
libecap::protocolWais.assignHostId(AnyP::PROTO_WAIS);
libecap::protocolUrn.assignHostId(AnyP::PROTO_URN);
libecap::protocolWhois.assignHostId(AnyP::PROTO_WHOIS);
- protocolCacheObj.assignHostId(AnyP::PROTO_CACHE_OBJECT);
protocolIcp.assignHostId(AnyP::PROTO_ICP);
#if USE_HTCP
protocolHtcp.assignHostId(AnyP::PROTO_HTCP);
case AnyP::PROTO_HTCP:
return protocolHtcp;
#endif
- case AnyP::PROTO_CACHE_OBJECT:
- return protocolCacheObj;
case AnyP::PROTO_ICY:
return protocolIcy;
case AnyP::PROTO_COAP:
PROTO_COAP,
PROTO_COAPS,
PROTO_WAIS,
- PROTO_CACHE_OBJECT,
PROTO_ICP,
#if USE_HTCP
PROTO_HTCP,
* Scheme names consist of a sequence of characters beginning with a
* letter and followed by any combination of letters, digits, plus
* ("+"), period ("."), or hyphen ("-").
- *
- * The underscore ("_") required to match "cache_object://" squid
- * special URI scheme.
*/
- static const auto schemeChars =
-#if USE_HTTP_VIOLATIONS
- CharacterSet("special", "_") +
-#endif
- CharacterSet("scheme", "+.-") + CharacterSet::ALPHA + CharacterSet::DIGIT;
+ static const auto schemeChars = CharacterSet("scheme", "+.-") + CharacterSet::ALPHA + CharacterSet::DIGIT;
SBuf str;
if (tok.prefix(str, schemeChars, 16) && tok.skip(':') && CharacterSet::ALPHA[str.at(0)]) {
case AnyP::PROTO_URN:
case AnyP::PROTO_HTTP:
- case AnyP::PROTO_CACHE_OBJECT:
return true;
case AnyP::PROTO_FTP:
case AnyP::PROTO_WAIS:
return 210;
- case AnyP::PROTO_CACHE_OBJECT:
- return CACHE_HTTP_PORT;
-
case AnyP::PROTO_WHOIS:
return 43;
return cmd->profile->creator->create(cmd);
}
-static const CharacterSet &
-MgrFieldChars(const AnyP::ProtocolType &protocol)
-{
- // Deprecated cache_object:// scheme used '@' to delimit passwords
- if (protocol == AnyP::PROTO_CACHE_OBJECT) {
- static const CharacterSet fieldChars = CharacterSet("cache-object-field", "@?#").complement();
- return fieldChars;
- }
-
- static const CharacterSet actionChars = CharacterSet("mgr-field", "?#").complement();
- return actionChars;
-}
-
/**
- * define whether the URL is a cache-manager URL and parse the action
- * requested by the user. Checks via CacheManager::ActionProtection() that the
- * item is accessible by the user.
+ * Parses the action requested by the user and checks via
+ * CacheManager::ActionProtection() that the item is accessible by the user.
*
* Syntax:
*
- * scheme "://" authority [ '/squid-internal-mgr' ] path-absolute [ '@' unreserved ] '?' query-string
+ * [ scheme "://" authority ] '/squid-internal-mgr' path-absolute [ "?" query ] [ "#" fragment ]
*
- * see RFC 3986 for definitions of scheme, authority, path-absolute, query-string
+ * see RFC 3986 for definitions of scheme, authority, path-absolute, query
*
* \returns Mgr::Command object with action to perform and parameters it might use
*/
Parser::Tokenizer tok(uri.path());
static const SBuf internalMagicPrefix("/squid-internal-mgr/");
- if (!tok.skip(internalMagicPrefix) && !tok.skip('/'))
- throw TextException("invalid URL path", Here());
+ Assure(tok.skip(internalMagicPrefix));
Mgr::Command::Pointer cmd = new Mgr::Command();
cmd->params.httpUri = SBufToString(uri.absolute());
- const auto &fieldChars = MgrFieldChars(uri.getScheme());
+ static const auto fieldChars = CharacterSet("mgr-field", "?#").complement();
SBuf action;
if (!tok.prefix(action, fieldChars)) {
- if (uri.getScheme() == AnyP::PROTO_CACHE_OBJECT) {
- static const SBuf menuReport("menu");
- action = menuReport;
- } else {
- static const SBuf indexReport("index");
- action = indexReport;
- }
+ static const SBuf indexReport("index");
+ action = indexReport;
}
cmd->params.actionName = SBufToString(action);
throw TextException(ToSBuf("action '", action, "' is ", prot), Here());
cmd->profile = profile;
- SBuf passwd;
- if (uri.getScheme() == AnyP::PROTO_CACHE_OBJECT && tok.skip('@')) {
- (void)tok.prefix(passwd, fieldChars);
- cmd->params.password = SBufToString(passwd);
- }
-
// TODO: fix when AnyP::Uri::parse() separates path?query#fragment
SBuf params;
if (tok.skip('?')) {
throw TextException("invalid characters in URL", Here());
// else ignore #fragment (if any)
- debugs(16, 3, "MGR request: host=" << uri.host() << ", action=" << action <<
- ", password=" << passwd << ", params=" << params);
+ debugs(16, 3, "MGR request: host=" << uri.host() << ", action=" << action << ", params=" << params);
return cmd;
}
DEFAULT: ssl::certSelfSigned ssl_error X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
ENDIF
DEFAULT: all src all
-DEFAULT: manager url_regex -i ^cache_object:// +i ^[^:]+://[^/]+/squid-internal-mgr/
+DEFAULT: manager url_regex +i ^[^:]+://[^/]+/squid-internal-mgr/
DEFAULT: localhost src 127.0.0.1/32 ::1
DEFAULT: to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1/128 ::/128
DEFAULT: to_linklocal dst 169.254.0.0/16 fe80::/10
/* BUG: Squid cannot deal with '*' URLs (RFC2616 5.1.2) */
- static const SBuf cache_object("cache_object://");
- if (hp->requestUri().startsWith(cache_object))
- return nullptr; /* already in good shape */
-
// XXX: re-use proper URL parser for this
SBuf url = hp->requestUri(); // use full provided URI if we abort
do { // use a loop so we can break out of it
request->flags.internal = http->flags.internal;
- if (request->url.getScheme() == AnyP::PROTO_CACHE_OBJECT)
- request->flags.disableCacheUse("cache_object URL scheme");
-
if (!isFtp) {
// XXX: for non-HTTP messages instantiate a different Http::Message child type
// for now Squid only supports HTTP requests
if (request->url.getScheme() == AnyP::PROTO_HTTP)
return method.respMaybeCacheable();
- if (request->url.getScheme() == AnyP::PROTO_CACHE_OBJECT)
- return 0;
-
return 1;
}
CPPUNIT_ASSERT(mgr != nullptr);
std::vector<AnyP::ProtocolType> validSchemes = {
- AnyP::PROTO_CACHE_OBJECT,
AnyP::PROTO_HTTP,
AnyP::PROTO_HTTPS,
AnyP::PROTO_FTP
for (const auto *magic : magicPrefixes) {
- // all schemes except cache_object require magic path prefix bytes
- if (scheme != AnyP::PROTO_CACHE_OBJECT && strlen(magic) <= 2)
+ // all schemes require magic path prefix bytes
+ if (strlen(magic) <= 2)
continue;
/* Check the parser accepts all the valid cases */
AnyP::UriScheme lhs_none(AnyP::PROTO_NONE), rhs_none(AnyP::PROTO_NONE);
CPPUNIT_ASSERT_EQUAL(lhs_none, rhs_none);
- AnyP::UriScheme lhs_cacheobj(AnyP::PROTO_CACHE_OBJECT), rhs_cacheobj(AnyP::PROTO_CACHE_OBJECT);
+ AnyP::UriScheme lhs_cacheobj(AnyP::PROTO_HTTP), rhs_cacheobj(AnyP::PROTO_HTTP);
CPPUNIT_ASSERT_EQUAL(lhs_cacheobj, rhs_cacheobj);
CPPUNIT_ASSERT(lhs_none != rhs_cacheobj);
}
CPPUNIT_ASSERT(AnyP::UriScheme() == AnyP::PROTO_NONE);
CPPUNIT_ASSERT(not (AnyP::UriScheme(AnyP::PROTO_WAIS) == AnyP::PROTO_HTTP));
CPPUNIT_ASSERT(AnyP::PROTO_HTTP == AnyP::UriScheme(AnyP::PROTO_HTTP));
- CPPUNIT_ASSERT(not (AnyP::PROTO_CACHE_OBJECT == AnyP::UriScheme(AnyP::PROTO_HTTP)));
+ CPPUNIT_ASSERT(not (AnyP::PROTO_HTTPS == AnyP::UriScheme(AnyP::PROTO_HTTP)));
}
/*