--- /dev/null
- <p>No changes to existing directives in this version.
+<!doctype linuxdoc system>
+<article>
+<title>Squid 5.0.0 release notes</title>
+<author>Squid Developers</author>
+
+<abstract>
+This document contains the release notes for version 4 of Squid.
+Squid is a WWW Cache application developed by the National Laboratory
+for Applied Network Research and members of the Web Caching community.
+</abstract>
+
+<toc>
+
+<sect>Notice
+<p>The Squid Team are pleased to announce the release of Squid-5.0.0 for testing.
+
+This new release is available for download from <url url="http://www.squid-cache.org/Versions/v5/"> or the
+ <url url="http://www.squid-cache.org/Download/http-mirrors.html" name="mirrors">.
+
+<p>While this release is not deemed ready for production use, we believe it is ready for wider testing by the community.
+
+<p>We welcome feedback and bug reports. If you find a bug, please see <url url="http://wiki.squid-cache.org/SquidFaq/BugReporting">
+ for how to submit a report with a stack trace.
+
+<sect1>Known issues
+<p>Although this release is deemed good enough for use in many setups, please note the existence of
+<url url="http://bugs.squid-cache.org/buglist.cgi?query_format=advanced&product=Squid&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&version=5" name="open bugs against Squid-5">.
+
+<sect1>Changes since earlier releases of Squid-5
+<p>
+The Squid-4 change history can be <url url="http://www.squid-cache.org/Versions/v5/changesets/" name="viewed here">.
+
+
+<sect>Major new features since Squid-4
+<p>Squid-5 represents a new feature release above Squid-4.
+
+<p>The most important of these new features are:
+<itemize>
+ <item>ICAP Trailers
+</itemize>
+
+Most user-facing changes are reflected in squid.conf (see below).
+
+
+<sect1>ICAP Trailers
+<p>Details in <url url="https://datatracker.ietf.org/doc/draft-rousskov-icap-trailers/" name="Draft: ICAP Trailers">
+
+<p>The <em>Trailers</em> feature from HTTP is being proposed for addition to ICAP,
+ with some modifications.
+
+<p>This implementation complies with version -01 of that draft:
+<itemize>
+ <item>Announces ICAP Trailer support via the ICAP Allow request header field.
+ <item>Parses the ICAP response trailer if and only if the ICAP server signals
+ its presence by sending both Trailer header and Allow/trailers in the
+ ICAP response.
+</itemize>
+
+<p>For now Squid logs and ignores all parsed ICAP header fields.
+
+
+<sect>Changes to squid.conf since Squid-4
+<p>
+There have been changes to Squid's configuration file since Squid-4.
+
+This section gives a thorough account of those changes in three categories:
+
+<itemize>
+ <item><ref id="newdirectives" name="New directives">
+ <item><ref id="modifieddirectives" name="Changes to existing directives">
+ <item><ref id="removeddirectives" name="Removed directives">
+</itemize>
+<p>
+
+<sect1>New directives<label id="newdirectives">
+<p>
+<descrip>
+ <p>No new directives in this version.
+
+</descrip>
+
+<sect1>Changes to existing directives<label id="modifieddirectives">
+<p>
+<descrip>
- <p>No removed options in this version.
++ <tag>acl</tag>
++ <p>Due to differences between GNU Regex and libc regular expressions
++ patterns escaping the double quote (") character escaped by a slash (\)
++ will now be rejected. Use without the escaping is still accepted.
++ This affects all *_regex and regular expression based ACL types.
++
++ <tag>refresh_pattern</tag>
++ <p>Due to differences between GNU Regex and libc regular expressions
++ patterns escaping the double quote (") character with a slash (\)
++ will now be rejected. Use without the escaping is still accepted.
+
+</descrip>
+
+<sect1>Removed directives<label id="removeddirectives">
+<p>
+<descrip>
+ <p>No removed directives in this version.
+
+</descrip>
+
+
+<sect>Changes to ./configure options since Squid-4
+<p>
+There have been some changes to Squid's build configuration since Squid-4.
+
+This section gives an account of those changes in three categories:
+
+<itemize>
+ <item><ref id="newoptions" name="New options">
+ <item><ref id="modifiedoptions" name="Changes to existing options">
+ <item><ref id="removedoptions" name="Removed options">
+</itemize>
+
+
+<sect1>New options<label id="newoptions">
+<p>
+<descrip>
+ <p>No new options in this version.
+
+</descrip>
+
+<sect1>Changes to existing options<label id="modifiedoptions">
+<p>
+<descrip>
+ <p>No changes to existing options in this version.
+
+</descrip>
+</p>
+
+<sect1>Removed options<label id="removedoptions">
+<p>
+<descrip>
++ <tag>--enable-gnuregex</tag>
++ <p>Squid now uses C++11 std::regex instead of GNU Regex. Removed.
++
++ <tag>LDFLAGS</tag>
++ <p>Squid now uses C++11 std::regex API instead of the C regex.h API.
++ This means that linker overrides for -lregex and regex.h no longer exist.
++ <p>Custom regex libraries need to provide bindings for the std::regex
++ API to link with Squid. This may require additional -I path to be
++ provided in CXXFLAGS to the library headers. Refer to the chosen
++ library documentation for more details.
++ <p>Note that popular modern high performance regex libraries should
++ already be used by the STL internal implementation and no longer
++ need manually linking.
+
+</descrip>
+
+
+<sect>Regressions since Squid-2.7
+
+<p>Some squid.conf options which were available in Squid-2.7 are not yet available in Squid-5
+
+<p>If you need something to do then porting one of these from Squid-2 is most welcome.
+
+<sect1>Missing squid.conf options available in Squid-2.7
+<p>
+<descrip>
+ <tag>broken_vary_encoding</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>cache_peer</tag>
+ <p><em>monitorinterval=</em> not yet ported from 2.6
+ <p><em>monitorsize=</em> not yet ported from 2.6
+ <p><em>monitortimeout=</em> not yet ported from 2.6
+ <p><em>monitorurl=</em> not yet ported from 2.6
+
+ <tag>cache_vary</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>error_map</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>external_refresh_check</tag>
+ <p>Not yet ported from 2.7
+
+ <tag>location_rewrite_access</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>location_rewrite_children</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>location_rewrite_concurrency</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>location_rewrite_program</tag>
+ <p>Not yet ported from 2.6
+
+ <tag>refresh_pattern</tag>
+ <p><em>stale-while-revalidate=</em> not yet ported from 2.7
+ <p><em>ignore-stale-while-revalidate=</em> not yet ported from 2.7
+ <p><em>negative-ttl=</em> not yet ported from 2.7
+
+ <tag>refresh_stale_hit</tag>
+ <p>Not yet ported from 2.7
+
+ <tag>update_headers</tag>
+ <p>Not yet ported from 2.7
+
+</descrip>
+
+<sect>Copyright
+<p>
+Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+<p>
+Squid software is distributed under GPLv2+ license and includes
+contributions from numerous individuals and organizations.
+Please see the COPYING and CONTRIBUTORS files for details.
+
+</article>
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testACLMaxUserIP_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
- $(SQUID_CPPUNIT_LA) \
$(SSLLIB) \
$(KRB5LIBS) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testCacheManager_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
-
tests_testDiskIO_LDFLAGS = $(LIBADD_DL)
tests_testDiskIO_DEPENDENCIES = \
DiskIO/libdiskio.la \
$(top_builddir)/lib/libmiscutil.la \
ipc/libipc.la \
mgr/libmgr.la \
+ store/libstore.la \
+ sbuf/libsbuf.la \
$(SNMP_LIBS) \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
- $(SQUID_CPPUNIT_LA) \
$(SSLLIB) \
$(KRB5LIBS) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testEvent_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscutil.la \
ipc/libipc.la \
mgr/libmgr.la \
+ sbuf/libsbuf.la \
+ store/libstore.la \
$(SNMP_LIBS) \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
- $(SQUID_CPPUNIT_LA) \
$(SSLLIB) \
$(KRB5LIBS) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testEventLoop_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
- $(SQUID_CPPUNIT_LA) \
$(SSLLIB) \
$(KRB5LIBS) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_test_http_range_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
- $(SQUID_CPPUNIT_LA) \
$(SSLLIB) \
$(KRB5LIBS) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testHttpRequest_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
CommCalls.o \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testStore_LDFLAGS = $(LIBADD_DL)
base/libbase.la \
libsquid.la \
ip/libip.la \
+ sbuf/libsbuf.la \
$(top_builddir)/lib/libmiscutil.la \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testString_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testUfs_LDFLAGS = $(LIBADD_DL)
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(NETTLELIB) \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testRock_LDFLAGS = $(AM_CPPFLAGS) $(LIBADD_DL)
comm/libcomm.la \
log/liblog.la \
format/libformat.la \
- $(REGEXLIB) \
+ store/libstore.la \
+ sbuf/libsbuf.la \
$(REPL_OBJS) \
$(ADAPTATION_LIBS) \
$(ESI_LIBS) \
nodist_tests_testConfigParser_SOURCES = \
$(TESTSOURCES)
tests_testConfigParser_LDADD = \
- base/libbase.la \
libsquid.la \
ip/libip.la \
+ sbuf/libsbuf.la \
+ base/libbase.la \
$(top_builddir)/lib/libmiscutil.la \
- $(REGEXLIB) \
- $(SQUID_CPPUNIT_LIBS) \
$(SSLLIB) \
+ $(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testConfigParser_LDFLAGS = $(LIBADD_DL)
// keeping the flags values consistent
for (auto &i : data) {
if (i.flags != flags) {
- if ((i.flags®_ICASE) != 0) {
+ if ((i.flags & std::regex::icase)) {
- sl.push_back(SBuf("-i"));
+ sl.emplace_back("-i");
} else {
- sl.push_back(SBuf("+i"));
+ sl.emplace_back("+i");
}
flags = i.flags;
}
if (RE == NULL || *RE == '\0')
return curlist.empty(); // XXX: old code did this. It looks wrong.
- regex_t comp;
- if (int errcode = regcomp(&comp, RE, flags)) {
- char errbuf[256];
- regerror(errcode, &comp, errbuf, sizeof errbuf);
+ // std::regex constructor does the actual compile and throws on invalid patterns
+ try {
+ curlist.emplace_back(flags, RE);
+
+ } catch(std::regex_error &e) {
- debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line);
+ debugs(28, DBG_CRITICAL, cfg_filename << " line " << config_lineno << ": " << config_input_line);
- debugs(28, DBG_CRITICAL, "ERROR: invalid regular expression: '" << RE << "': " << errbuf);
+ debugs(28, DBG_CRITICAL, "ERROR: invalid regular expression: '" << RE << "': " << e.code());
return false;
- }
- debugs(28, 2, "compiled '" << RE << "' with flags " << flags);
- curlist.emplace_back(flags, RE);
- curlist.back().regex = comp;
+ } catch(...) {
- debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line);
++ debugs(28, DBG_CRITICAL, cfg_filename << " line " << config_lineno << ": " << config_input_line);
+ debugs(28, DBG_CRITICAL, "ERROR: invalid regular expression: '" << RE << "': (unknown error)");
+ return false;
+ }
+ debugs(28, 2, "compiled '" << RE << "' with flags " << flags);
return true;
}
char largeRE[BUFSIZ];
*largeRE = 0;
- while (wl != NULL) {
+ for (const SBuf & configurationLineWord : sl) {
int RElen;
- RElen = strlen( wl->key );
+ RElen = configurationLineWord.length();
- if (strcmp(wl->key, "-i") == 0) {
+ static const SBuf minus_i("-i");
+ static const SBuf plus_i("+i");
+ if (configurationLineWord == minus_i) {
- if (flags & REG_ICASE) {
+ if ((flags & std::regex::icase)) {
/* optimisation of -i ... -i */
debugs(28, 2, "optimisation of -i ... -i" );
} else {
debugs(28, 2, "-i" );
if (!compileRE(newlist, largeRE, flags))
return 0;
- flags |= REG_ICASE;
+ flags |= std::regex::icase;
largeRE[largeREindex=0] = '\0';
}
- } else if (strcmp(wl->key, "+i") == 0) {
+ } else if (configurationLineWord == plus_i) {
- if ((flags & REG_ICASE) == 0) {
+ if (!(flags & std::regex::icase)) {
/* optimisation of +i ... +i */
debugs(28, 2, "optimisation of +i ... +i");
} else {
}
static void
-compileUnoptimisedREs(std::list<RegexPattern> &curlist, wordlist * wl)
+compileUnoptimisedREs(std::list<RegexPattern> &curlist, const SBufList &sl)
{
- int flags = REG_EXTENDED | REG_NOSUB;
+ auto flags = std::regex::extended | std::regex::nosubs;
- while (wl != NULL) {
- if (strcmp(wl->key, "-i") == 0) {
+ static const SBuf minus_i("-i"), plus_i("+i");
+ for (auto configurationLineWord : sl) {
+ if (configurationLineWord == minus_i) {
- flags |= REG_ICASE;
+ flags |= std::regex::icase;
- } else if (strcmp(wl->key, "+i") == 0) {
+ } else if (configurationLineWord == plus_i) {
- flags &= ~REG_ICASE;
+ flags &= ~std::regex::icase;
} else {
- if (!compileRE(curlist, wl->key , flags))
- debugs(28, DBG_CRITICAL, "ERROR: Skipping regular expression. Compile failed: '" << wl->key << "'");
+ if (!compileRE(curlist, configurationLineWord.c_str() , flags))
+ debugs(28, DBG_CRITICAL, "ERROR: Skipping regular expression. "
+ "Compile failed: '" << configurationLineWord << "'");
}
- wl = wl->next;
}
}
#include "squid.h"
#include "base/RegexPattern.h"
+#include <utility>
- RegexPattern::RegexPattern(int aFlags, const char *aPattern) :
- flags(aFlags),
- pattern(xstrdup(aPattern))
- {
- memset(®ex, 0, sizeof(regex));
- }
-
- RegexPattern::RegexPattern(RegexPattern &&o) :
- flags(std::move(o.flags)),
- regex(std::move(o.regex)),
- pattern(std::move(o.pattern))
- {
- memset(&o.regex, 0, sizeof(o.regex));
- o.pattern = nullptr;
- }
-
- RegexPattern::~RegexPattern()
- {
- xfree(pattern);
- regfree(®ex);
- }
+ RegexPattern::RegexPattern(const std::regex_constants::syntax_option_type &aFlags, const char *aPattern) :
+ flags(aFlags),
+ pattern(xstrdup(aPattern)),
+ regex(pattern, flags)
+ {}
-RegexPattern::~RegexPattern()
+RegexPattern &
+RegexPattern::operator =(RegexPattern &&o)
{
- xfree(pattern);
+ flags = std::move(o.flags);
+ regex = std::move(o.regex);
- memset(&o.regex, 0, sizeof(o.regex));
- pattern = std::move(o.pattern);
++ pattern = o.pattern;
+ o.pattern = nullptr;
+ return *this;
}
+
public:
RegexPattern() = delete;
- RegexPattern(int aFlags, const char *aPattern);
- ~RegexPattern();
-
- // regex type varies by library, usually not safe to copy
+ RegexPattern(const std::regex_constants::syntax_option_type &aFlags, const char *aPattern); // throws std::regex_error
RegexPattern(const RegexPattern &) = delete;
-
- RegexPattern(RegexPattern &&);
+ RegexPattern &operator =(const RegexPattern &) = delete;
- ~RegexPattern();
+ RegexPattern(RegexPattern &&) = default; // throws std::regex_error
+ RegexPattern &operator =(RegexPattern &&);
++ ~RegexPattern() { xfree(pattern); }
-- const char * c_str() const {return pattern;}
- bool match(const char *str) const {return regexec(®ex,str,0,NULL,0)==0;}
- bool match(const char *str) const {return std::regex_search(str, regex);}
++ const char * c_str() const { return pattern; }
++ bool match(const char *str) const { return std::regex_search(str, regex); }
public:
- int flags;
- regex_t regex;
+ std::regex_constants::syntax_option_type flags;
private:
char *pattern;
int ignore_private = 0;
#endif
- int i;
- RefreshPattern *t;
- regex_t comp;
- int errcode;
- int flags = REG_EXTENDED | REG_NOSUB;
-
- if ((token = ConfigParser::RegexPattern()) != NULL) {
+ auto flags = std::regex::extended | std::regex::nosubs;
- if ((token = ConfigParser::RegexPattern()) != NULL) {
++ if ((token = ConfigParser::RegexPattern())) {
if (strcmp(token, "-i") == 0) {
- flags |= REG_ICASE;
+ flags |= std::regex::icase;
token = ConfigParser::RegexPattern();
} else if (strcmp(token, "+i") == 0) {
- flags &= ~REG_ICASE;
+ flags &= ~std::regex::icase;
token = ConfigParser::RegexPattern();
}
-
-- }
--
-- if (token == NULL) {
++ } else {
debugs(3, DBG_CRITICAL, "FATAL: refresh_pattern missing the regex pattern parameter");
self_destruct();
return;
max = (time_t) (i * 60); /* convert minutes to seconds */
/* Options */
-- while ((token = ConfigParser::NextToken()) != NULL) {
++ while ((token = ConfigParser::NextToken())) {
if (!strcmp(token, "refresh-ims")) {
refresh_ims = 1;
} else if (!strcmp(token, "store-stale")) {
/* DEBUG: section 25 MIME Parsing and Internal Icons */
#include "squid.h"
-#include "disk.h"
+ #include "base/RegexPattern.h"
#include "fde.h"
+#include "fs_io.h"
#include "globals.h"
#include "HttpHdrCc.h"
#include "HttpReply.h"