#
AC_DEFUN([SQUID_CC_CHECK_ARGUMENT],[
AC_CACHE_CHECK([whether compiler accepts $2],[$1],
- [{
+ [
AC_REQUIRE([AC_PROG_CC])
- SAVED_CFLAGS="$CFLAGS"
- SAVED_CXXFLAGS="$CXXFLAGS"
+ SQUID_STATE_SAVE([ARGCHECK])
CFLAGS="$CFLAGS $2"
CXXFLAGS="$CXXFLAGS $2"
AC_TRY_LINK([],[int foo; ],
[$1=yes],[$1=no])
- CFLAGS="$SAVED_CFLAGS"
- CXXFLAGS="$SAVED_CXXFLAGS"
- }])
+ SQUID_STATE_ROLLBACK([ARGCHECK])
+ ])
])
# Check if the compiler requires a supplied flag to build a test program.
AC_CACHE_CHECK([whether compiler requires $2],[$1],
[{
AC_REQUIRE([AC_PROG_CC])
- SAVED_CFLAGS="$CFLAGS"
- SAVED_CXXFLAGS="$CXXFLAGS"
+ SQUID_STATE_SAVE([ARGREQ])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM($3,$4)],[$1=no],[],[$1=no])
if test "x$$1" != "xno" ; then
CFLAGS="$CFLAGS $2"
CXXFLAGS="$CXXFLAGS $2"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM($3,$4)],[$1=yes],[$1=no],[$1=no])
fi
- CFLAGS="$SAVED_CFLAGS"
- CXXFLAGS="$SAVED_CXXFLAGS"
+ SQUID_STATE_ROLLBACK([ARGREQ])
}])
])
]) dnl AC_CACHE_CHECK
]) dnl AC_DEFUN
+AC_DEFUN([SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED_INTERNAL],[
+ SQUID_STATE_SAVE([CXXARGTEST])
+ CXXFLAGS="$CXXFLAGS $SQUID_CXXFLAGS"
+ SQUID_CC_CHECK_ARGUMENT([$2],[$1])
+ SQUID_STATE_ROLLBACK([CXXARGTEST])
+ AS_IF([test "x${$2}" = "xyes"],[SQUID_CXXFLAGS="$SQUID_CXXFLAGS $1"])
+])
+
+dnl argument is a compiler flag. It will be attempted, and if suppported
+dnl it will be added to SQUID_CXXFLAGS in the same order as calls to the macro
+AC_DEFUN([SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED],[
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED_INTERNAL($1,m4_bpatsubst(m4_tolower([squid_cv_cc_arg$1]),[[^a-zA-Z0-9_]], [_]))
+])
+
# define the flag to use to have the compiler treat warnings as errors
# requirs SQUID_CC_GUESS_VARIANT
# Sets a few variables to contain some compiler-dependent command line
squid_cv_cc_arg_pipe=""
;;
clang)
- squid_cv_cxx_option_werror="-Werror -Qunused-arguments"
+ squid_cv_cxx_option_werror="-Werror"
squid_cv_cc_option_werror="$squid_cv_cxx_option_werror"
squid_cv_cc_option_wall="-Wall"
squid_cv_cc_option_optimize="-O2"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <security/pam_appl.h>
static int
-password_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { return 0; }
+password_conversation(int, const struct pam_message **, struct pam_response **, void *) { return 0; }
static struct pam_conv conv = { &password_conversation, 0 };
]])], [
squid_cv_pam_conv_signature=linux
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <security/pam_appl.h>
static int
-password_conversation(int num_msg, struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { return 0; }
+password_conversation(int, struct pam_message **, struct pam_response **, void *) { return 0; }
static struct pam_conv conv = { &password_conversation, 0 };
]])], [
squid_cv_pam_conv_signature=solaris
AC_USE_SYSTEM_EXTENSIONS
fi
+AC_MSG_CHECKING([compiler name-version])
+squid_cv_cc_name=`$CC --version | head -1 | cut -f1 -d" "`
+AS_CASE([$squid_cv_cc_name],
+ [gcc|clang],[squid_cv_cc_majversion=`$CC -dumpversion | cut -f1 -d.`],
+ [squid_cv_cc_majversion="unknown"]
+)
+squid_cv_cc_simplified="$squid_cv_cc_name-$squid_cv_cc_majversion"
+AC_MSG_RESULT($squid_cv_cc_simplified)
+
+# warning flags
+AS_IF([test "$squid_cv_cc_simplified" = "gcc-4"],[
+ AC_MSG_NOTICE([skipping -Wextra on $squid_cv_cc_simplified])
+],[
+ # -Werror must be first
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Werror])
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wextra])
+ # -Wunused-private-field causes a huge number of false positives
+ # in unit tests. Disable that
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wno-unused-private-field])
+ # ...=2: This flexibility level allows GCC to "understand" our fallthrough
+ # comments. TODO: Switch to [[fallthrough]] attributes with C++17.
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wimplicit-fallthrough=2])
+ AS_IF([test "x$squid_cv_cc_implicit_fallthrough2" = "xno"], [
+ SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wno-implicit-fallthrough])
+ ])
+])
# If the user did not specify a C++ version.
user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="`
if test "x$user_cxx" = "x"; then
fi
fi
-dnl set squid required flags
-if test "$squid_cv_compiler" = "gcc"; then
- case "$squid_host_os" in
- mingw)
-dnl Guido Serassio (serassio@squid-cache.org) 20070811
-dnl Using the latest MinGW (gcc 3.4.5 + mingw-runtime 3.13) cannot build with
-dnl -Werror -Wmissing-prototypes -Wmissing-declarations
-dnl TODO: check if the problem will be present in any other newer MinGW release.
- SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow"
- ;;
- *)
- SQUID_CFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow"
- ;;
- esac
- SQUID_CXXFLAGS="$squid_cv_cc_option_wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual"
-else
- SQUID_CFLAGS=
- SQUID_CXXFLAGS=
-fi
+# useful warnings that may not be included in -Wall -Wextra
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wpointer-arith])
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wwrite-strings])
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wcomments])
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wshadow])
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Wmissing-declarations])
+SQUID_CC_ADD_CXXFLAG_IF_SUPPORTED([-Woverloaded_virtual])
dnl CentOS (and RHEL) still define ntohs() using deprecated C++ features
SQUID_CC_REQUIRE_ARGUMENT([ac_cv_require_wno_deprecated_register],[-Werror -Wno-deprecated-register],[[#include <arpa/inet.h>]],[[int fox=ntohs(1);]])
template <class V>
SplayConstIterator<V>
-SplayConstIterator<V>::operator ++ (int dummy)
+SplayConstIterator<V>::operator ++ (int)
{
SplayConstIterator<V> result = *this;
advance();
break;
case 7:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 6:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 5:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 4:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 3:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 2:
HASH4;
- /* FALLTHROUGH */
+ /* [[fallthrough]] */
case 1:
HASH4;
}
#include <iostream>
-bool
+static bool
CaseSensitiveCheck()
{
Trie aTrie;
return 0;
}
-bool
+static bool
CaseInsensitiveCheck()
{
Trie aTrie(new TrieCaseless);
return 0;
}
-int main (int argc, char **argv)
+int main (int, char **)
{
if (CaseSensitiveCheck()) {
std::cerr << "Case sensitive check failure." << std::endl;
int incr;
};
-void
-DelayTaggedUpdateWalkee(DelayTaggedBucket::Pointer const ¤t, void *state)
-{
- DelayTaggedUpdater *t = (DelayTaggedUpdater *)state;
- /* This doesn't change the value of the DelayTaggedBucket, so is safe */
- const_cast<DelayTaggedBucket *>(current.getRaw())->theBucket.update(t->spec, t->incr);
-}
-
struct DelayTaggedUpdateVisitor {
DelayTaggedUpdater *updater;
explicit DelayTaggedUpdateVisitor(DelayTaggedUpdater *u) : updater(u) {}
DelayUserFree(DelayUserBucket::Pointer &)
{}
-void
-DelayUserStatsWalkee(DelayUserBucket::Pointer const ¤t, void *state)
-{
- current->stats ((StoreEntry *)state);
-}
-
struct DelayUserStatsVisitor {
StoreEntry *se;
explicit DelayUserStatsVisitor(StoreEntry *s) : se(s) {}
int incr;
};
-void
-DelayUserUpdateWalkee(DelayUserBucket::Pointer const ¤t, void *state)
-{
- DelayUserUpdater *t = (DelayUserUpdater *)state;
- /* This doesn't change the value of the DelayUserBucket, so is safe */
- const_cast<DelayUserBucket *>(current.getRaw())->theBucket.update(t->spec, t->incr);
-}
-
struct DelayUserUpdateVisitor {
DelayUserUpdater *t;
DelayUserUpdateVisitor(DelayUserUpdater *updater) : t(updater) {}
}
void
-DelayVector::update(int incr)
+DelayVector::update(int)
{
/*
* Each pool updates itself,
int disker;
};
-std::ostream &
+static std::ostream &
operator <<(std::ostream &os, const SipcIo &sio)
{
return os << "ipcIo" << sio.worker << '.' << sio.msg.requestId <<
method_(method), fwd_(fwd), answer_() {}
/* CallDialer API */
- virtual bool canDial(AsyncCall &call) { return fwd_.valid(); }
- void dial(AsyncCall &call) { ((&(*fwd_))->*method_)(answer_); }
+ virtual bool canDial(AsyncCall &) { return fwd_.valid(); }
+ void dial(AsyncCall &) { ((&(*fwd_))->*method_)(answer_); }
virtual void print(std::ostream &os) const {
os << '(' << fwd_.get() << ", " << answer_ << ')';
}
#include "fde.h"
#include "http/StatusCode.h"
#include "ip/Address.h"
+#include "ip/forward.h"
#include "PeerSelectState.h"
#include "ResolvedPeers.h"
#include "security/forward.h"
PconnRace pconnRace; ///< current pconn race state
};
-void getOutgoingAddress(HttpRequest * request, const Comm::ConnectionPointer &conn);
+class acl_tos;
+tos_t aclMapTOS(acl_tos *, ACLChecklist *);
+
+Ip::NfMarkConfig aclFindNfMarkConfig(acl_nfmark *, ACLChecklist *);
+void getOutgoingAddress(HttpRequest *, const Comm::ConnectionPointer &);
/// a collection of previously used persistent Squid-to-peer HTTP(S) connections
extern PconnPool *fwdPconnPool;
std::vector<HttpHeaderFieldStat> ccHeaderStats(HttpHdrCcType::CC_ENUM_END);
/// used to walk a table of http_header_cc_type structs
-HttpHdrCcType &operator++ (HttpHdrCcType &aHeader)
+static HttpHdrCcType &
+operator++ (HttpHdrCcType &aHeader)
{
int tmp = (int)aHeader;
aHeader = (HttpHdrCcType)(++tmp);
{
// check invariant on initialization table
for (unsigned int j = 0; CcAttrs[j].name != nullptr; ++j) {
- assert (static_cast<int>(CcAttrs[j].id) == j);
+ assert(static_cast<decltype(j)>(CcAttrs[j].id) == j);
}
}
offset <= donor->offset && donor->offset < rhs;
}
+#else
+ (void)donor;
#endif
return merged;
}
#include "http/forward.h"
#include "HttpHdrScTarget.h"
+#include "mem/PoolingAllocator.h"
#include "SquidString.h"
#include <list>
HttpHdrSc *httpHdrScParseCreate(String const &);
void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
+http_hdr_sc_type &operator++(http_hdr_sc_type &);
#endif /* SQUID_HTTPHDRSURROGATECONTROL_H */
/* DEBUG: section 90 HTTP Cache Control Header */
#include "squid.h"
+#include "HttpHdrSc.h"
#include "HttpHdrScTarget.h"
#include "StatHist.h"
-http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader);
/* copies non-extant fields from new_sc to this sc */
void
HttpHdrScTarget::mergeWith(const HttpHdrScTarget * new_sc)
extern const HttpHeaderStat *dump_stat; /* argh! */
const HttpHeaderStat *dump_stat = NULL;
-void
+static void
httpHeaderFieldStatDumper(StoreEntry * sentry, int, double val, double, int count)
{
const int id = static_cast<int>(val);
}
void
-LoadableModule::load(int mode)
+LoadableModule::load()
{
if (loaded())
throw TexcHere("internal error: reusing LoadableModule object");
- theHandle = openModule(mode);
+ theHandle = openModule();
if (!loaded())
throw TexcHere(errorMsg());
}
void *
-LoadableModule::openModule(int mode)
+LoadableModule::openModule()
{
return lt_dlopen(theName.termedBuf());
}
// wrapper for dlopen(3), libltdl, and friends
class LoadableModule
{
-public:
- enum LoadMode { lmNow, lmLazy };
-
public:
LoadableModule(const String &aName);
~LoadableModule(); // unloads if loaded
const String &name() const { return theName; }
const String &error() const { return theError; }
- void load(int mode = lmNow); // throws Texc
+ void load(); // throws Texc
void unload(); // throws Texc
protected:
void *theHandle;
private:
- void *openModule(int mode);
+ void *openModule();
bool closeModule();
const char *errorMsg();
};
tools.cc \
tools.h \
tunnel.cc \
+ tunnel.h \
typedefs.h \
urn.cc \
urn.h \
tests/stub_SBuf.cc \
String.cc \
tests/stub_debug.cc \
+ tests/stub_event.cc \
tests/stub_libmem.cc
tests_testString_LDADD = \
base/libbase.la \
tools.cc \
tools.h \
tests/stub_tunnel.cc \
+ tunnel.h \
urn.cc \
urn.h \
tests/stub_wccp2.cc \
tools.cc \
tools.h \
tests/stub_tunnel.cc \
+ tunnel.h \
urn.cc \
urn.h \
tests/stub_wccp2.cc \
tools.cc \
tools.h \
tests/stub_tunnel.cc \
+ tunnel.h \
urn.cc \
urn.h \
tests/stub_wccp2.cc \
cache_cf.h \
tests/stub_cbdata.cc \
tests/stub_debug.cc \
+ tests/stub_event.cc \
tests/stub_fatal.cc \
fatal.h \
tests/stub_libmem.cc \
tools.cc \
tools.h \
tests/stub_tunnel.cc \
+ tunnel.h \
urn.cc \
urn.h \
tests/stub_wccp2.cc \
DelayId largestAllowance = mostBytesAllowed ();
return largestAllowance.bytesWanted(0, max);
}
+#else
+ (void)ignoreDelayPools;
#endif
return max;
store_client *sc = (store_client *) node->data;
sc->delayId.setNoDelay(newValue);
}
-
+#else
+ (void)newValue;
#endif
}
if (slotLimit > 0) {
const unsigned int slotsFree =
Ipc::Mem::PagesAvailable(Ipc::Mem::PageId::cachePage);
- if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
- const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
+ if (slotsFree <= static_cast<unsigned int>(slotLimit)) {
+ const int usedSlots = slotLimit - static_cast<int>(slotsFree);
storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n",
usedSlots, (100.0 * usedSlots / slotLimit));
}
}
void
-MessageDelayConfig::dumpResponseDelayPoolParameters(StoreEntry *entry, const char *name)
+MessageDelayConfig::dumpResponseDelayPoolParameters(StoreEntry *entry)
{
auto &pools = MessageDelayPools::Instance()->pools;
for (auto pool: pools)
{
public:
void parseResponseDelayPool();
- void dumpResponseDelayPoolParameters(StoreEntry *e, const char *name);
+ void dumpResponseDelayPoolParameters(StoreEntry *);
void parseResponseDelayPoolAccess();
void freePools();
};
}
inline void
-dump_response_delay_pool_parameters(StoreEntry *entry, const char *name, MessageDelayConfig &cfg)
+dump_response_delay_pool_parameters(StoreEntry *entry, const char *, MessageDelayConfig &cfg)
{
- cfg.dumpResponseDelayPoolParameters(entry, name);
+ cfg.dumpResponseDelayPoolParameters(entry);
}
inline void
public:
virtual int bytesWanted (int minimum, int maximum) const {return max(minimum,maximum);}
- virtual void bytesIn(int qty) {}
+ virtual void bytesIn(int) {}
};
#endif
#endif /* NULLDELAYID_H */
}
void
-PeerPoolMgr::handleSecureClosure(const CommCloseCbParams ¶ms)
+PeerPoolMgr::handleSecureClosure(const CommCloseCbParams &)
{
Must(closer != NULL);
Must(securer != NULL);
int pipeline_max_prefetch;
+ // these values are actually unsigned
+ // TODO: extend the parser to support more nuanced types
int forward_max_tries;
int connect_retries;
stats.mem.size =
Ipc::Mem::PageLevel(Ipc::Mem::PageId::cachePage) * pageSize;
stats.mem.count = currentCount();
+#else
+ (void)stats;
#endif
}
* Solaris code by R. Gancarz <radekg@solaris.elektrownia-lagisza.com.pl>
*/
-Eui::Eui48 *
+static Eui::Eui48 *
aclParseArpData(const char *t)
{
char buf[256];
return eui64Data.empty();
}
-Eui::Eui64 *
+static Eui::Eui64 *
aclParseEuiData(const char *t)
{
char buf[256];
assert(!rfc931[0]);
if (ident)
xstrncpy(rfc931, ident, USER_IDENT_SZ);
+#else
+ (void)ident;
#endif
}
return data->empty();
}
-acl_httpstatus_data*
+static acl_httpstatus_data*
aclParseHTTPStatusData(const char *t)
{
int status;
* is an entry in some address-based access control element. This
* function is called via ACLIP::match() and the splay library.
*/
-int
+static int
aclIpAddrNetworkCompare(acl_ip_data * const &p, acl_ip_data * const &q)
{
Ip::Address A = p->addr1;
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "%s: FATAL: Unknown option: -%c. Exiting\n", program_name, opt);
usage(argv[0]);
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "%s: FATAL: Unknown option: -%c. Exiting\n", program_name, opt);
usage(argv[0]);
struct ldap_creds *cp = (struct ldap_creds *) params;
return tool_sasl_bind(ld, cp->dn, cp->pw);
}
-#endif
+#endif /* HAVE_SASL_H || HAVE_SASL_SASL_H || HAVE_SASL_DARWIN */
static LDAP_REBIND_PROC ldap_simple_rebind;
#elif HAVE_LDAP_REBIND_FUNCTION
#ifndef LDAP_REFERRALS
#define LDAP_REFERRALS
-#endif
+#endif /* LDAP_REFERRALS */
#if HAVE_SASL_H || HAVE_SASL_SASL_H || HAVE_SASL_DARWIN
static LDAP_REBIND_FUNCTION ldap_sasl_rebind;
static LDAP_REBIND_PROC ldap_sasl_rebind;
static int
-ldap_sasl_rebind(LDAP * ld, LDAP_CONST char *, ber_tag_t request,
- ber_int_t msgid, void *params)
+ldap_sasl_rebind(LDAP * ld, LDAP_CONST char *, ber_tag_t,
+ ber_int_t, void *params)
{
struct ldap_creds *cp = (struct ldap_creds *) params;
return tool_sasl_bind(ld, cp->dn, cp->pw);
static LDAP_REBIND_PROC ldap_simple_rebind;
static int
-ldap_simple_rebind(LDAP * ld, LDAP_CONST char *, ber_tag_t request,
- ber_int_t msgid, void *params)
+ldap_simple_rebind(LDAP * ld, LDAP_CONST char *, ber_tag_t,
+ ber_int_t, void *params)
{
struct ldap_creds *cp = (struct ldap_creds *) params;
* char *sasl_secprops = (char *)"maxssf=56";
* char *sasl_secprops = NULL;
*/
- struct berval passwd = {0, NULL};
+ struct berval passwd = {};
void *defaults;
int rc = LDAP_SUCCESS;
static int session_active(const char *details, size_t len)
{
#if USE_BERKLEYDB
- DBT key = {0};
- DBT data = {0};
+ DBT key = {};
+ DBT data = {};
key.data = (void *)details;
key.size = len;
#elif USE_TRIVIALDB
TDB_DATA key;
TDB_DATA data;
+ (void)len;
+#else
+ (void)len;
#endif
if (fetchKey(key, &data)) {
time_t timestamp;
static void
session_login(/*const*/ char *details, size_t len)
{
- DB_ENTRY key = {0};
- DB_ENTRY data = {0};
+ DB_ENTRY key = {};
+ DB_ENTRY data = {};
time_t now = time(0);
#if USE_BERKLEYDB
key.data = static_cast<decltype(key.data)>(details);
static void
session_logout(/*const*/ char *details, size_t len)
{
- DB_ENTRY key = {0};
+ DB_ENTRY key = {};
#if USE_BERKLEYDB
key.data = static_cast<decltype(key.data)>(details);
key.size = len;
switch (opt) {
case 'T':
fixed_timeout = 1;
+ /* [[fallthrough]] */
case 't':
session_ttl = strtol(optarg, NULL, 0);
break;
} else {
fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
}
- // fall through to display help texts.
-
+ /* [[fallthrough]] */
default:
usage(argv[0]);
exit(EXIT_FAILURE);
case State::writingInit: // waiting for service OPTIONS
Must(state.serviceWaiting);
+ return;
case State::writingConnect: // waiting for the connection to establish
-
case State::writingHeaders: // waiting for the headers to be written
-
case State::writingPaused: // waiting for the ICAP server response
-
case State::writingReallyDone: // nothing more to write
return;
} else
buf.appendf("%s: %s\r\n", TheConfig.client_username_header, value);
}
+#else
+ (void)request;
+ (void)buf;
#endif
}
/*
* return true if we can serve requests for this method.
*/
-int
+bool
urlCheckRequest(const HttpRequest * r)
{
- int rc = 0;
/* protocol "independent" methods
*
* actually these methods are specific to HTTP:
*/
if (r->method == Http::METHOD_CONNECT)
- return 1;
+ return true;
// we support OPTIONS and TRACE directed at us (with a 501 reply, for now)
// we also support forwarding OPTIONS and TRACE, except for the *-URI ones
return (r->header.getInt64(Http::HdrType::MAX_FORWARDS) == 0 || r->url.path() != AnyP::Uri::Asterisk());
if (r->method == Http::METHOD_PURGE)
- return 1;
+ return true;
/* does method match the protocol? */
switch (r->url.getScheme()) {
case AnyP::PROTO_URN:
-
case AnyP::PROTO_HTTP:
-
case AnyP::PROTO_CACHE_OBJECT:
- rc = 1;
- break;
+ return true;
case AnyP::PROTO_FTP:
-
- if (r->method == Http::METHOD_PUT)
- rc = 1;
+ if (r->method == Http::METHOD_PUT ||
+ r->method == Http::METHOD_GET ||
+ r->method == Http::METHOD_HEAD )
+ return true;
+ return false;
case AnyP::PROTO_GOPHER:
-
case AnyP::PROTO_WAIS:
-
case AnyP::PROTO_WHOIS:
- if (r->method == Http::METHOD_GET)
- rc = 1;
- else if (r->method == Http::METHOD_HEAD)
- rc = 1;
-
- break;
+ if (r->method == Http::METHOD_GET ||
+ r->method == Http::METHOD_HEAD)
+ return true;
+ return false;
case AnyP::PROTO_HTTPS:
-#if USE_OPENSSL
- rc = 1;
-#elif USE_GNUTLS
- rc = 1;
+#if USE_OPENSSL || USE_GNUTLS
+ return true;
#else
/*
- * Squid can't originate an SSL connection, so it should
- * never receive an "https:" URL. It should always be
- * CONNECT instead.
- */
- rc = 0;
+ * Squid can't originate an SSL connection, so it should
+ * never receive an "https:" URL. It should always be
+ * CONNECT instead.
+ */
+ return false;
#endif
- break;
default:
- break;
+ return false;
}
- return rc;
+ /* notreached */
+ return false;
}
AnyP::Uri::Uri(AnyP::UriScheme const &aScheme) :
char *
AnyP::Uri::cleanup(const char *uri)
{
- int flags = 0;
char *cleanedUri = nullptr;
switch (Config.uri_whitespace) {
- case URI_WHITESPACE_ALLOW:
- flags |= RFC1738_ESCAPE_NOSPACE;
- // fall through to next case
- case URI_WHITESPACE_ENCODE:
- flags |= RFC1738_ESCAPE_UNESCAPED;
+ case URI_WHITESPACE_ALLOW: {
+ const auto flags = RFC1738_ESCAPE_NOSPACE | RFC1738_ESCAPE_UNESCAPED;
cleanedUri = xstrndup(rfc1738_do_escape(uri, flags), MAX_URL);
break;
+ }
+
+ case URI_WHITESPACE_ENCODE:
+ cleanedUri = xstrndup(rfc1738_do_escape(uri, RFC1738_ESCAPE_UNESCAPED), MAX_URL);
+ break;
case URI_WHITESPACE_CHOP: {
- flags |= RFC1738_ESCAPE_UNESCAPED;
const auto pos = strcspn(uri, w_space);
char *choppedUri = nullptr;
if (pos < strlen(uri))
choppedUri = xstrndup(uri, pos + 1);
- cleanedUri = xstrndup(rfc1738_do_escape(choppedUri ? choppedUri : uri, flags), MAX_URL);
+ cleanedUri = xstrndup(rfc1738_do_escape(choppedUri ? choppedUri : uri,
+ RFC1738_ESCAPE_UNESCAPED), MAX_URL);
cleanedUri[pos] = '\0';
xfree(choppedUri);
+ break;
}
- break;
case URI_WHITESPACE_DENY:
case URI_WHITESPACE_STRIP:
*q = '\0';
cleanedUri = xstrndup(rfc1738_escape_unescaped(tmp_uri), MAX_URL);
xfree(tmp_uri);
+ break;
}
- break;
}
assert(cleanedUri);
* \retval -1 means the host is less than the domain
*/
int matchDomainName(const char *host, const char *domain, MatchDomainNameFlags flags = mdnNone);
-int urlCheckRequest(const HttpRequest *);
+bool urlCheckRequest(const HttpRequest *);
void urlExtMethodConfigure(void);
#endif /* SQUID_SRC_ANYP_URI_H */
}
}
-const AnyP::ProtocolType
+AnyP::ProtocolType
AnyP::UriScheme::FindProtocolType(const SBuf &scheme)
{
if (scheme.isEmpty())
static void Init();
/// \returns ProtocolType for the given scheme name or PROTO_UNKNOWN
- static const AnyP::ProtocolType FindProtocolType(const SBuf &);
+ static AnyP::ProtocolType FindProtocolType(const SBuf &);
private:
/// optimization: stores down-cased protocol scheme names, copied from
if (request->auth_user_request == NULL) {
request->auth_user_request = *auth_user_request;
}
-
- /* fallthrough to ERROR case and do the challenge */
+ *auth_user_request = nullptr;
+ return AUTH_ACL_CHALLENGE;
case Auth::CRED_ERROR:
/* this ACL check is finished. */
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "FATAL: Unknown option: -%c\n", opt);
usage(argv[0]);
case Helper::TT:
debugs(29, DBG_IMPORTANT, "ERROR: Digest auth does not support the result code received. Using the wrong helper program? received: " << reply);
- // fall through to next case. Handle this as an ERR response.
+ // [[fallthrough]] to handle this as an ERR response
case Helper::TimedOut:
case Helper::BrokenHelper:
+ // [[fallthrough]] to (silently) handle this as an ERR response
// TODO retry the broken lookup on another helper?
- // fall through to next case for now. Handle this as an ERR response silently.
case Helper::Error: {
/* allow this because the digest_request pointer is purely local */
Auth::Digest::UserRequest *digest_request = dynamic_cast<Auth::Digest::UserRequest *>(auth_user_request.getRaw());
digest_request->setDenyMessage(msgNote.c_str());
} else if (reply.other().hasContent()) {
// old helpers did send ERR result but a bare message string instead of message= key name.
+ // TODO deprecate and remove old auth digest helper protocol
digest_request->setDenyMessage(reply.other().content());
if (!oldHelperWarningDone) {
debugs(29, DBG_IMPORTANT, "WARNING: Digest auth helper returned old format ERR response. It needs to be upgraded.");
* tied to it, even if MAYBE the client could handle it - Kinkie */
rep->header.delByName("keep-alive");
request->flags.proxyKeepalive = false;
- /* fall through */
+ /* [[fallthrough]] */
case Auth::Ok:
/* Special case: authentication finished OK but disallowed by ACL.
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "ERROR: unknown option: -%c. Exiting\n", opt);
usage();
case Helper::Unknown:
debugs(29, DBG_IMPORTANT, "ERROR: Negotiate Authentication Helper crashed (" << reply.reservationId << ")");
- /* continue to the next case */
+ /* [[fallthrough]] */
case Helper::TimedOut:
case Helper::BrokenHelper:
return var;
}
-char *
+static char *
pstrcpy( char *src, const char *dst)
{
if (dst) {
return src;
}
-char *
+static char *
pstrcat( char *src, const char *dst)
{
if (dst) {
return buf;
}
-void usage(void)
+static void
+usage()
{
fprintf(stderr, "Usage: \n");
fprintf(stderr, "negotiate_wrapper [-h] [-d] --ntlm ntlm helper + arguments --kerberos kerberos helper + arguments\n");
/* here it makes sense to drop the connection, as auth is
* tied to it, even if MAYBE the client could handle it - Kinkie */
request->flags.proxyKeepalive = false;
- /* fall through */
+ /* [[fallthrough]] */
case Auth::Ok:
/* Special case: authentication finished OK but disallowed by ACL.
* Need to start over to give the client another chance.
*/
- /* fall through */
+ /* [[fallthrough]] */
case Auth::Unchecked:
/* semantic change: do not drop the connection.
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "unknown option: -%c. Exiting\n", opt);
usage();
case Helper::Unknown:
debugs(29, DBG_IMPORTANT, "ERROR: NTLM Authentication Helper crashed (" << reply.reservationId << ")");
- /* continue to the next case */
+ /* [[fallthrough]] */
case Helper::TimedOut:
case Helper::BrokenHelper:
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "unknown option: -%c. Exiting\n", opt);
usage();
#include "auth/toUtf.h"
#include "sbuf/SBuf.h"
+#include <limits>
+
SBuf
Latin1ToUtf8(const char *in)
{
size_t bytesToWrite = 0;
char sequence[4] = {0, 0, 0, 0};
+ static_assert(std::numeric_limits<unsigned char>::max() == 0xFFu,
+ "we require char to be exactly 8 bits");
if (ch < 0x80)
u = ch;
- else if (ch >= 0xC0 && ch <= 0xFF) // 0x0410..0x044F
+ else if (ch >= 0xC0) // 0x0410..0x044F
u = 0x0350 + ch;
else
u = unicodevalues[ch - 0x80];
case 3:
sequence[2] = static_cast<char>(u & 0x3f) | 0x80;
u >>= 6;
- // fall through
+ /* [[fallthrough]] */
case 2:
sequence[1] = static_cast<char>(u & 0x3f) | 0x80;
u >>= 6;
- // fall through
+ /* [[fallthrough]] */
case 1:
sequence[0] = static_cast<char>(u) | firstByteMark[bytesToWrite];
- // fall through
}
result.append(sequence, bytesToWrite);
}
// Everything else falls through when "true"...
case 4:
if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ /* [[fallthrough]] */
case 3:
if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ /* [[fallthrough]] */
case 2:
if ((a = (*--srcptr)) > 0xBF) return false;
if (a < 0x80) return false;
break;
}
+ /* [[fallthrough]] */
case 1:
if (*source >= 0x80 && *source < 0xC2) return false;
static const char *const B_MBYTES_STR = "MB";
static const char *const B_GBYTES_STR = "GB";
-static const char *const list_sep = ", \t\n\r";
-
// std::chrono::years requires C++20. Do our own rough calculation for now.
static const double HoursPerYear = 24*365.2522;
storeAppendPrintf(entry, "%s %" PRId64 "\n", name, var);
}
-void
+static void
parse_int64_t(int64_t *var)
{
int64_t i;
#define free_tristate free_int
-void
+static void
parse_pipelinePrefetch(int *var)
{
char *token = ConfigParser::PeekAtToken();
storeAppendPrintf(entry, "%s %d seconds\n", name, (int)(var/1000) );
}
-void
-parse_time_msec(time_msec_t * var)
+static void
+parse_time_msec(time_msec_t *var)
{
*var = parseTimeLine<std::chrono::milliseconds>().count();
}
#include "squid.h"
#include "CachePeer.h"
+#include "carp.h"
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
dlinkAdd(c, &c->link, &cbdataEntries);
debugs(45, 3, "Allocating " << p << " " << file << ":" << line);
#else
+ (void)file;
+ (void)line;
debugs(45, 9, "Allocating " << p);
#endif
return p;
}
-void
+static void
cbdataRealFree(cbdata *c, const char *file, const int line)
{
#if WITH_VALGRIND
dlinkDelete(&c->link, &cbdataEntries);
#else
debugs(45, 9, "Freeing " << p);
+ (void)file;
+ (void)line;
#endif
#if WITH_VALGRIND
\code
void *cbdata;
...
- if (cbdataReferenceValidDone(reference, &cbdata)) != NULL)
+ if (cbdataReferenceValidDone(reference, &cbdata)))
callback(..., cbdata);
\endcode
*
- * \param var The reference variable. Will be automatically cleared to NULL.
+ * \param var The reference variable. Will be automatically cleared to nullptr
* \param ptr A temporary pointer to the referenced data (if valid).
*/
int cbdataInternalReferenceDoneValid(void **p, void **tp);
*
* \deprecated Prefer the use of CbcPointer<> smart pointer.
*
- * \param var The reference variable. Will be automatically cleared to NULL.
+ * \param var The reference variable. Will be automatically cleared to nullptr
*/
-#define cbdataReferenceDone(var) do {if (var) {cbdataInternalUnlock(var); var = NULL;}} while(0)
+#define cbdataReferenceDone(var) do {if (var) {cbdataInternalUnlock(var); var = nullptr;}} while(0)
/**
* A generic wrapper for passing object pointers through cbdata.
state = sSTART;
} else if (strcmp(buff, "CONFIG_START") == 0) {
state = sCFGLINES;
- } else { // if (buff != NULL) {
+ } else {
assert(buff != NULL);
entries.back().doc.push_back(buff);
}
case sCFGLINES:
if (strcmp(buff, "CONFIG_END") == 0) {
state = sDOC;
- } else { // if (buff != NULL) {
+ } else {
assert(buff != NULL);
entries.back().cfgLines.push_back(buff);
}
static std::string esc;
esc.clear();
- for (int i = 0; i < var.length(); ++i) {
- switch (var[i]) {
+ for (const auto c : var) {
+ switch (c) {
case '"':
case '\\':
esc += '\\';
+ /* [[fallthrough]] */
default:
- esc += var[i];
+ esc += c;
}
}
}
#endif // USE_OPENSSL
-/// ConnStateData::tunnelOnError() wrapper. Reduces code changes. TODO: Remove.
-bool
-clientTunnelOnError(ConnStateData *conn, Http::StreamPointer &context, HttpRequest::Pointer &request, const HttpRequestMethod& method, err_type requestError)
-{
- assert(conn);
- assert(conn->pipeline.front() == context);
- return conn->tunnelOnError(method, requestError);
-}
-
/// initiate tunneling if possible or return false otherwise
bool
-ConnStateData::tunnelOnError(const HttpRequestMethod &method, const err_type requestError)
+ConnStateData::tunnelOnError(const HttpRequestMethod &, const err_type requestError)
{
if (!Config.accessList.on_unsupported_protocol) {
debugs(33, 5, "disabled; send error: " << requestError);
HttpRequest::Pointer request = context->http->request;
debugs(83, 5, "Got something other than TLS Client Hello. Cannot SslBump.");
updateError(ERR_PROTOCOL_UNKNOWN, parseErrorDetails);
- if (!clientTunnelOnError(this, context, request, HttpRequestMethod(), ERR_PROTOCOL_UNKNOWN))
+ if (!tunnelOnError(HttpRequestMethod(), ERR_PROTOCOL_UNKNOWN))
clientConnection->close();
return;
}
}
}
-void httpsSslBumpStep2AccessCheckDone(Acl::Answer answer, void *data)
+static void
+httpsSslBumpStep2AccessCheckDone(Acl::Answer answer, void *data)
{
ConnStateData *connState = (ConnStateData *) data;
/// noteTakeServerConnectionControl() callback parameter
class ServerConnectionContext {
public:
- ServerConnectionContext(const Comm::ConnectionPointer &conn, const HttpRequest::Pointer &req, const SBuf &post101Bytes): preReadServerBytes(post101Bytes), conn_(conn) { conn_->enterOrphanage(); }
+ ServerConnectionContext(const Comm::ConnectionPointer &conn, const SBuf &post101Bytes) : preReadServerBytes(post101Bytes), conn_(conn) { conn_->enterOrphanage(); }
/// gives to-server connection to the new owner
Comm::ConnectionPointer connection() { conn_->leaveOrphanage(); return conn_; }
/// tunneling them to the server later (on_unsupported_protocol)
bool shouldPreserveClientData() const;
- // TODO: move to the protected section when removing clientTunnelOnError()
- bool tunnelOnError(const HttpRequestMethod &, const err_type);
-
/// build a fake http request
ClientHttpRequest *buildFakeRequest(Http::MethodType const method, SBuf &useHost, unsigned short usePort, const SBuf &payload);
/// whether preservedClientData is valid and should be kept up to date
bool preservingClientData_ = false;
+ bool tunnelOnError(const HttpRequestMethod &, const err_type);
+
private:
/* ::Server API */
virtual void terminateAll(const Error &, const LogTagsErrors &);
CSD clientSocketDetach;
void clientProcessRequest(ConnStateData *, const Http1::RequestParserPointer &, Http::Stream *);
+void clientProcessRequestFinished(ConnStateData *, const HttpRequest::Pointer &);
void clientPostHttpsAccept(ConnStateData *);
std::ostream &operator <<(std::ostream &os, const ConnStateData::PinnedIdleContext &pic);
return;
} else if (r->conditional()) {
debugs(88, 5, "conditional HIT");
- if (processConditional(result))
+ if (processConditional())
return;
}
/// process conditional request from client
bool
-clientReplyContext::processConditional(StoreIOBuffer &result)
+clientReplyContext::processConditional()
{
StoreEntry *const e = http->storeEntry();
debugs(88, 5, m << ' ' << url << ' ' << storeKeyText(key));
#if USE_HTCP
neighborsHtcpClear(nullptr, req, m, HTCP_CLR_INVALIDATION);
+#else
+ (void)req;
#endif
Store::Root().evictIfFound(key);
}
bool alwaysAllowResponse(Http::StatusCode sline) const;
int checkTransferDone();
void processOnlyIfCachedMiss();
- bool processConditional(StoreIOBuffer &result);
+ bool processConditional();
void cacheHit(StoreIOBuffer result);
void handleIMSReply(StoreIOBuffer result);
void sendMoreData(StoreIOBuffer result);
CollapsedRevalidation collapsedRevalidation;
};
+// TODO: move to SideAgent parent, when we have one
+void purgeEntriesByUrl(HttpRequest *, const char *);
+
#endif /* SQUID_CLIENTSIDEREPLY_H */
#include "fd.h"
#include "fde.h"
#include "format/Token.h"
+#include "FwdState.h"
#include "gopher.h"
#include "helper.h"
#include "helper/Reply.h"
* the callout. This is strictly for convenience.
*/
-tos_t aclMapTOS (acl_tos * head, ACLChecklist * ch);
-Ip::NfMarkConfig aclFindNfMarkConfig (acl_nfmark * head, ACLChecklist * ch);
-
void
ClientHttpRequest::doCallouts()
{
state = SENT_EPSV_2;
break;
}
- // else fall through to skip EPSV 2
+ /* [[fallthrough]] to skip EPSV 2 */
case SENT_EPSV_2: /* EPSV IPv6 failed. Try EPSV IPv4 */
if (ctrl.conn->local.isIPv4()) {
failed(ERR_FTP_FAILURE, 0);
return false;
}
- // else fall through to skip EPSV 1
+ /* [[fallthrough]] to skip EPSV 1 */
case SENT_EPSV_1: /* EPSV options exhausted. Try PASV now. */
debugs(9, 5, "FTP Channel (" << ctrl.conn->remote << ") rejects EPSV connection attempts. Trying PASV instead.");
loginParser(auth, false);
}
/* we fail with authorization-required error later IFF the FTP server requests it */
+#else
+ (void)req_hdr;
#endif
/* Test URL login syntax. Overrides any headers received. */
/* add Authenticate header */
// XXX: performance regression. c_str() may reallocate
newrep->header.putAuth("Basic", realm.c_str());
+#else
+ (void)realm;
#endif
return newrep;
}
}
void
-Http::Tunneler::handleConnectionClosure(const CommCloseCbParams ¶ms)
+Http::Tunneler::handleConnectionClosure(const CommCloseCbParams &)
{
closer = nullptr;
bailWith(new ErrorState(ERR_CONNECT_FAIL, Http::scBadGateway, request.getRaw(), al));
return anErrno == ENFILE || anErrno == EMFILE;
}
-void
+static void
comm_set_v6only(int fd, int tos)
{
#ifdef IPV6_V6ONLY
* - OpenBSD divert-to support,
* - FreeBSD IPFW TPROXY v4 support.
*/
-void
+static void
comm_set_transparent(int fd)
{
#if _SQUID_LINUX_ && defined(IP_TRANSPARENT) // Linux
comm_close(fd);
}
-void
+static void
commStartTlsClose(const FdeCbParams ¶ms)
{
Security::SessionSendGoodbye(fd_table[params.fd].ssl);
}
-void
+static void
comm_close_complete(const FdeCbParams ¶ms)
{
fde *F = &fd_table[params.fd];
/* DEBUG: section 00 Debug Routines */
#include "squid.h"
+#include "base/TextException.h"
#include "Debug.h"
#include "DebugMessages.h"
#include "fd.h"
#if HAVE_SYSLOG
_db_print_syslog(forceAlert, format, args3);
+#else
+ (void)forceAlert;
#endif
#if _SQUID_WINDOWS_
#endif /* LOG_LOCAL4 */
}
+#else /* HAVE_SYSLOG */
+
+void
+_db_set_syslog(const char *)
+{
+ throw TextException("Logging to syslog is not available on this platform", Here());
+}
+
#endif
void
}
DelayIdComposite::Pointer
-Aggregate::id(CompositeSelectionDetails &details)
+Aggregate::id(CompositeSelectionDetails &)
{
if (rate()->restore_bps != -1)
return new AggregateId (this);
}
void
-DelayPools::Update(void *unused)
+DelayPools::Update(void *)
{
if (!pools())
return;
#include "ip/tools.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
+#include "snmp_agent.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
};
/// \ingroup ErrorPageInternal
-err_type &operator++ (err_type &anErr)
+static err_type &
+operator++ (err_type &anErr)
{
int tmp = (int)anErr;
anErr = (err_type)(++tmp);
}
/// \ingroup ErrorPageInternal
-int operator - (err_type const &anErr, err_type const &anErr2)
+static int
+operator -(err_type const &anErr, err_type const &anErr2)
{
return (int)anErr - (int)anErr2;
}
debugs(4, DBG_IMPORTANT, "WARNING: Error Pages Missing Language: " << lang);
}
}
+#else
+ (void)request;
#endif
return loaded();
case 'O':
if (!building_deny_info_url)
do_quote = 0;
+ /* [[fallthrough]] */
case 'o':
p = request ? request->extacl_message.termedBuf() : external_acl_message;
if (!p && !building_deny_info_url)
}
esiProcessResult_t
-ESIAssign::process (int dovars)
+ESIAssign::process (int)
{
assert (varState);
{}
void
-ESIVariableExpression::eval (ESIVarState &state, char const *subref, char const *defaultOnEmpty) const
+ESIVariableExpression::eval (ESIVarState &state, char const *, char const *) const
{
/* XXX: Implement evaluation of the expression */
ESISegment::ListAppend (state.getOutput(), expression.rawBuf(), expression.size());
class ESIElement;
struct esiTreeParent : public RefCountable {
- virtual void provideData (ESISegment::Pointer data, ESIElement * source) {
+ virtual void provideData (ESISegment::Pointer /* data */ , ESIElement * /* source */ ) {
/* make abstract when all functionality complete */
assert (0);
}
- virtual void fail(ESIElement * source, char const *reason = NULL) {}
+ virtual void fail(ESIElement * /* source */, char const * /* reason */ = nullptr) {}
virtual ~esiTreeParent() {}
};
virtual void render (ESISegment::Pointer) = 0;
/* process this element */
- virtual esiProcessResult_t process (int dovars) {
+ virtual esiProcessResult_t process(int) {
debugs(86,5, "esiProcessComplete: Processed " << this);
return ESI_PROCESS_COMPLETE;
}
*/
/* make comparisons with refcount pointers easy */
-bool operator == (ESIElement const *lhs, ESIElement::Pointer const &rhs)
+static bool
+operator == (ESIElement const *lhs, ESIElement::Pointer const &rhs)
{
return lhs == rhs.getRaw();
}
}
void
-ESIContext::fail (ESIElement * source, char const *anError)
+ESIContext::fail(ESIElement *, char const *anError)
{
setError();
setErrorMessage (anError);
/* esiRemove */
void
-esiRemove::render(ESISegment::Pointer output)
+esiRemove::render(ESISegment::Pointer)
{
/* Removes do nothing dude */
debugs(86, 5, "esiRemoveRender: Rendering remove " << this);
}
}
-esiTry::esiTry(esiTry const &old)
+esiTry::esiTry(esiTry const &)
{
attempt = NULL;
except = NULL;
}
int
-evalliteral(stackmember * stack, int *depth, int whereAmI, stackmember * candidate)
+evalliteral(stackmember * /* stack */, int * /* depth */, int /* whereAmI */, stackmember * /* candidate */)
{
debugs(86, DBG_IMPORTANT, "attempt to evaluate a literal");
/* literals can't be evaluated */
}
int
-evalexpr(stackmember * stack, int *depth, int whereAmI, stackmember * candidate)
+evalexpr(stackmember * /* stack */, int * /* depth */, int /* whereAmI */, stackmember * /* candidate */)
{
debugs(86, DBG_IMPORTANT, "attempt to evaluate a sub-expression result");
/* sub-scpr's can't be evaluated */
}
int
-evalendexpr(stackmember * stack, int *depth, int whereAmI, stackmember * candidate)
+evalendexpr(stackmember * /* stack */, int * /* depth */, int /* whereAmI */, stackmember * /* candidate */)
{
/* Can't evaluate ) brackets */
return 1;
switch (clientStreamStatus (node, http)) {
- case STREAM_UNPLANNED_COMPLETE: /* fallthru ok */
-
+ case STREAM_UNPLANNED_COMPLETE:
case STREAM_COMPLETE: /* ok */
debugs(86, 3, "ESI subrequest finished OK");
esiStream->include->subRequestDone (esiStream, true);
}
esiProcessResult_t
-ESIInclude::process (int dovars)
+ESIInclude::process(int)
{
/* Prevent refcount race leading to free */
Pointer me (this);
EsiParserDefinition(ESILibxml2Parser);
// the SAX callback functions
-void esi_startElementSAXFunc(void * ctx, const xmlChar * name, const xmlChar ** atts)
+static void
+esi_startElementSAXFunc(void * ctx, const xmlChar * name, const xmlChar ** atts)
{
int count=0;
xmlChar **tmp = (xmlChar **)atts;
p->getClient()->start((const char *)name, (const char **)atts, count);
}
-void esi_endElementSAXFunc(void * ctx, const xmlChar * name)
+static void
+esi_endElementSAXFunc(void *ctx, const xmlChar *name)
{
ESILibxml2Parser *p = (ESILibxml2Parser *)ctx;
p->getClient()->end((const char *)name);
}
-void esi_commentSAXFunc(void * ctx, const xmlChar * value)
+static void
+esi_commentSAXFunc(void *ctx, const xmlChar *value)
{
ESILibxml2Parser *p = (ESILibxml2Parser *)ctx;
p->getClient()->parserComment((const char *)value);
}
-void esi_charactersSAXFunc(void *ctx, const xmlChar *ch, int len)
+static void
+esi_charactersSAXFunc(void *ctx, const xmlChar *ch, int len)
{
ESILibxml2Parser *p = (ESILibxml2Parser *)ctx;
p->getClient()->parserDefault((const char *)ch, len);
}
-xmlEntityPtr esi_getEntitySAXFunc(void * ctx, const xmlChar * name)
+static xmlEntityPtr
+esi_getEntitySAXFunc(void * /* ctx */, const xmlChar *name)
{
xmlEntityPtr res = xmlGetDocEntity(entity_doc, name);
}
void
-esiSequence::fail (ESIElement *source, char const *anError)
+esiSequence::fail(ESIElement * /* source */, char const *anError)
{
failed = true;
CBDATA_CLASS_INIT(ESIVarState);
void
-ESIVarState::Variable::eval (ESIVarState &state, char const *subref, char const *found_default) const
+ESIVarState::Variable::eval(ESIVarState &state, char const * , char const *found_default) const
{
/* No-op. We swallow it */
fmt.format = &tkn;
fmt.assemble(mb, ale, 0);
fmt.format = nullptr;
- } else
+ } else {
mb.append("-", 1);
+ }
return static_cast<size_t>(tokenSize);
}
int dofree = 0;
int64_t outoff = 0;
int dooff = 0;
- struct timeval outtv = {0, 0};
+ struct timeval outtv = {};
int doMsec = 0;
int doSec = 0;
bool doUint64 = false;
case LFT_REQUEST_URLGROUP_OLD_2X:
assert(LFT_REQUEST_URLGROUP_OLD_2X == 0); // should never happen.
+ break;
case LFT_NOTE:
tmp[0] = fmt->data.header.separator;
#include "fqdncache.h"
#include "helper.h"
#include "mgr/Registration.h"
+#include "snmp_agent.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "StatCounters.h"
/* Rebuild */
bool
-Rock::Rebuild::IsResponsible(const SwapDir &dir)
+Rock::Rebuild::IsResponsible(const SwapDir &)
{
// in SMP mode, only the disker is responsible for populating the map
return !UsingSmp() || IamDiskProcess();
static bool Start(SwapDir &dir);
protected:
- /// whether the current kid is responsible for rebuilding this db file
+ /// whether the current kid is responsible for rebuilding the given cache_dir
static bool IsResponsible(const SwapDir &);
Rebuild(SwapDir *dir, const Ipc::Mem::Pointer<Stats> &);
storeAppendPrintf(&e, "Maximum slots: %9d\n", slotLimit);
if (map && slotLimit > 0) {
const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size();
- if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
- const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
+ if (slotsFree <= static_cast<unsigned int>(slotLimit)) {
+ const int usedSlots = slotLimit - static_cast<int>(slotsFree);
storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n",
usedSlots, (100.0 * usedSlots / slotLimit));
}
#include "fd.h"
#include "FwdState.h"
#include "globals.h"
+#include "gopher.h"
#include "html_quote.h"
#include "HttpReply.h"
#include "HttpRequest.h"
}
}
+ break;
} /* HTML_CSO_RESULT */
-
default:
break; /* do nothing */
}
CloseHandle(hIpc);
}
+#else
+ (void)id_name;
#endif
}
}
CloseHandle(hIpc);
}
+#else
+ (void)id_name;
#endif
}
memset(hex, '\0', sizeof(hex));
}
+#else
+ (void)tag;
+ (void)s;
+ (void)sz;
#endif
}
case Http::scMisdirectedRequest:
statusAnswer = ReuseDecision::doNotCacheButShare;
statusReason = shareableError;
- // fall through to the actual decision making below
+ /* [[fallthrough]] to the actual decision making below */
case Http::scBadRequest: // no sharing; perhaps the server did not like something specific to this request
#if USE_HTTP_VIOLATIONS
if (flags.serverSwitchedProtocols) {
// pass server connection ownership to request->clientConnectionManager
- ConnStateData::ServerConnectionContext scc(serverConnection, request, inBuf);
+ ConnStateData::ServerConnectionContext scc(serverConnection, inBuf);
typedef UnaryMemFunT<ConnStateData, ConnStateData::ServerConnectionContext> MyDialer;
AsyncCall::Pointer call = asyncCall(11, 3, "ConnStateData::noteTakeServerConnectionControl",
MyDialer(request->clientConnectionManager,
/* glue to code generated by gperf */
#include "http/RegisteredHeadersHash.cci"
-HeaderTableRecord::HeaderTableRecord() :
- name(""), id(HdrType::BAD_HDR), type(HdrFieldType::ftInvalid),
- list(false), request(false), reply(false), hopbyhop(false), denied304(false)
-{}
-
HeaderTableRecord::HeaderTableRecord(const char *n) :
- name(n), id(HdrType::BAD_HDR), type(HdrFieldType::ftInvalid),
- list(false), request(false), reply(false), hopbyhop(false), denied304(false)
+ name(n)
{}
HeaderTableRecord::HeaderTableRecord(const char *n, HdrType theId, HdrFieldType theType, int theKind) :
};
/* POD for HeaderTable */
-class HeaderTableRecord {
-public:
- HeaderTableRecord();
+struct HeaderTableRecord {
+ HeaderTableRecord() = default;
HeaderTableRecord(const char *n);
HeaderTableRecord(const char *, Http::HdrType, Http::HdrFieldType, int /* HdrKind */);
-public:
- const char *name;
- Http::HdrType id;
- Http::HdrFieldType type;
+ const char *name = "";
+ Http::HdrType id = HdrType::BAD_HDR;
+ Http::HdrFieldType type = HdrFieldType::ftInvalid;
// flags set by constructor from HdrKind parameter
- bool list; ///<header with field values defined as #(values) in HTTP/1.1
- bool request; ///<header is a request header
- bool reply; ///<header is a reply header
- bool hopbyhop; ///<header is hop by hop
- bool denied304; ///<header is not to be updated on receiving a 304 in cache revalidation (see HttpReply.cc)
+ bool list = false;; ///< header with field values defined as #(values) in HTTP/1.1
+ bool request = false; ///< header is a request header
+ bool reply = false; ///< header is a reply header
+ bool hopbyhop = false; ///< header is hop by hop
+ bool denied304 = false; ///< header is not to be updated on receiving a 304 in cache revalidation (see HttpReply.cc)
};
/** Class for looking up registered header definitions
{
default:
hval += asso_values[static_cast<unsigned char>(str[8])];
- /*FALLTHROUGH*/
+ /* [[fallthrough]] */
case 8:
case 7:
case 6:
exit(EXIT_SUCCESS);
case '?':
opt = optopt;
- /* fall thru to default */
+ /* [[fallthrough]] */
default:
fprintf(stderr, "unknown option: -%c. Exiting\n", opt);
usage();
private:
// unused in IcmpPinger
- virtual void SendEcho(Ip::Address &to, int opcode, const char *payload, int len) {};
+ virtual void SendEcho(Ip::Address &, int, const char *, int) {}
/**
* Control channel(s) to squid.
// static Callback to wrap the squid-side ICMP handler.
// the IcmpSquid::Recv cannot be declared both static and virtual.
static void
-icmpSquidRecv(int unused1, void *unused2)
+icmpSquidRecv(int, void *)
{
icmpEngine.Recv();
}
#if USE_ICMP
debugs(37, 4, HERE << "'" << domain << "' (" << to << ")");
SendEcho(to, S_ICMP_DOM, domain, 0);
+#else
+ (void)to;
+ (void)domain;
#endif
}
}
static void
-netdbSaveState(void *foo)
+netdbSaveState(void *)
{
if (strcmp(Config.netdbFilename, "none") == 0)
return;
ipcache_nbgethostbyname(hostname, netdbSendPing,
new generic_cbdata(xstrdup(hostname)));
-
+#else
+ (void)hostname;
#endif
}
debugs(38, 3, "netdbHandlePingReply: " << n->network << "; rtt="<<
std::setw(5)<< std::setprecision(2) << n->rtt << " hops="<<
std::setw(4) << n->hops);
-
+#else
+ (void)from;
+ (void)hops;
+ (void)rtt;
#endif
}
n->last_use_time = squid_curtime;
return (int) (n->hops + 0.5);
}
-
+#else
+ (void)host;
#endif
return 0;
}
return (int) (n->rtt + 0.5);
}
+#else
+ (void)host;
#endif
return 0;
}
n->last_use_time = squid_curtime;
+#else
+ (void)hops;
+ (void)rtt;
+ (void)samp;
+ (void)host;
#endif
}
sizeof(net_db_peer),
sortPeerByRtt);
+#else
+ (void)ihops;
+ (void)irtt;
+ (void)e;
+ (void)url;
#endif
}
sizeof(net_db_peer),
sortPeerByRtt);
+#else
+ (void)hops;
+ (void)rtt;
+ (void)e;
+ (void)addr;
#endif
}
debugs(38, 3, "netdbDeleteAddrNetwork: " << n->network);
netdbRelease(n);
+#else
+ (void)addr;
#endif
}
ex->r->url.userInfo(SBuf(p->login));
FwdState::fwdStart(Comm::ConnectionPointer(), ex->e, ex->r.getRaw());
+#else
+ (void)data;
#endif
}
return p;
}
+#else
+ (void)ps;
#endif
return NULL;
}
/**
\ingroup pinger
\par This is the pinger external process.
- *
- \param argc Ignored.
- \param argv Ignored.
*/
int
-main(int argc, char *argv[])
+main(int, char **)
{
fd_set R;
int x;
icp_common_t *msg = nullptr; ///< ICP message with network byte order fields
DelayedUdpSend *next = nullptr; ///< invasive FIFO queue of delayed ICP messages
AccessLogEntryPointer ale; ///< sender's master transaction summary
- struct timeval queue_time = {0, 0}; ///< queuing timestamp
+ struct timeval queue_time = {}; ///< queuing timestamp
};
static void icpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int errNo);
}
/// \ingroup ServerProtocolICPInternal2
-void
+static void
icpUdpSendQueue(int fd, void *)
{
DelayedUdpSend *q;
return checklist.fastCheck().allowed();
}
-char const *
-icpGetUrlToSend(char *url)
-{
- if (strpbrk(url, w_space))
- return rfc1738_escape(url);
- else
- return url;
-}
-
HttpRequest *
icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from)
{
conn->local.toUrl(key1, IDENT_KEY_SZ);
conn->remote.toUrl(key2, IDENT_KEY_SZ);
- const auto res = snprintf(key, sizeof(key), "%s,%s", key1, key2);
+ int res = snprintf(key, sizeof(key), "%s,%s", key1, key2);
assert(res > 0);
- assert(static_cast<std::make_unsigned<decltype(res)>::type>(res) < sizeof(key));
+ assert(static_cast<unsigned int>(res) < sizeof(key));
if (!ident_hash) {
Init();
/* DEBUG: section 21 Integer functions */
#include "squid.h"
+#include "int.h"
#include <cmath>
#include "HttpReply.h"
#include "HttpRequest.h"
#include "icmp/net_db.h"
+#include "internal.h"
#include "MemBuf.h"
#include "SquidConfig.h"
#include "SquidTime.h"
debugs(89, 5, "address NAT: " << newConn);
return true;
}
+#else
+ (void)newConn;
#endif
return false;
}
debugs(89, 5, HERE << "address TPROXY: " << newConn);
return true;
#else
+ (void)newConn;
return false;
#endif
}
debugs(89, 5, HERE << "address NAT: " << newConn);
return true;
#else
+ (void)newConn;
return false;
#endif
}
newConn->local.getInAddr(natLookup.nl_inipaddr.in4);
newConn->remote.getInAddr(natLookup.nl_outipaddr.in4);
}
-#else
+#else /* HAVE_STRUCT_NATLOOKUP_NL_INIPADDR_IN6 */
// warn once every 10 at critical level, then push down a level each repeated event
static int warningLevel = DBG_CRITICAL;
debugs(89, warningLevel, "Your IPF (IPFilter) NAT does not support IPv6. Please upgrade it.");
}
newConn->local.getInAddr(natLookup.nl_inip);
newConn->remote.getInAddr(natLookup.nl_outip);
-#endif
+#endif /* HAVE_STRUCT_NATLOOKUP_NL_INIPADDR_IN6 */
natLookup.nl_inport = htons(newConn->local.port());
natLookup.nl_outport = htons(newConn->remote.port());
// ... and the TCP flag
x = ioctl(natfd, SIOCGNATL, &natLookup);
}
-#endif
+#endif /* defined(IPFILTER_VERSION) ... */
if (x < 0) {
const auto xerrno = errno;
if (xerrno != ESRCH) {
return true;
}
+#else
+ (void)newConn;
#endif /* --enable-ipf-transparent */
return false;
}
return true;
}
#endif /* --with-nat-devpf */
+#else
+ (void)newConn;
#endif /* --enable-pf-transparent */
return false;
}
}
#else /* none of the transparent options configured */
+ (void)newConn;
+ (void)listenConn;
debugs(89, DBG_IMPORTANT, "WARNING: transparent proxying not supported");
#endif
int xerrno = errno;
debugs(33, DBG_IMPORTANT, "QOS: error in setsockopt(IP_RECVTOS) on " << server << " " << xstrerr(xerrno));
}
+#else
+ (void)server;
+ (void)clientFde;
#endif
}
} else {
debugs(17, 2, "QOS: Failed to allocate new conntrack for netfilter CONNMARK retrieval.");
}
+#else
+ (void)conn;
+ (void)connDir;
#endif
return mark;
}
} else {
debugs(17, 2, "QOS: Failed to allocate new conntrack for netfilter CONNMARK modification.");
}
-#endif
+#else /* USE_LIBNETFILTERCONNTRACK */
+ (void)conn;
+ (void)connDir;
+ (void)cm;
+#endif /* USE_LIBNETFILTERCONNTRACK */
return ret;
}
}
return x;
#elif USE_LIBCAP
+ (void)mark;
+ (void)fd;
debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(SO_MARK) not supported on this platform");
return -1;
#else
+ (void)mark;
+ (void)fd;
debugs(50, DBG_IMPORTANT, "WARNING: Netfilter marking disabled (netfilter marking requires build with LIBCAP)");
return -1;
#endif
namespace Ip
{
class Address;
+class NfMarkConfig;
}
+class acl_nfmark;
/// Length of buffer that needs to be allocated to old a null-terminated IP-string
// Yuck. But there are still structures that need it to be an 'integer constant'.
#define MAX_IPSTRLEN 75
-
typedef uint32_t nfmark_t;
typedef unsigned char tos_t;
#include "ip/tools.h"
#include "ipcache.h"
#include "mgr/Registration.h"
+#include "snmp_agent.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "StatCounters.h"
#include "peer_userhash.h"
#include "PeerSelectState.h"
#include "profiler/Profiler.h"
+#include "protos.h"
#include "redirect.h"
#include "refresh.h"
#include "sbuf/Stream.h"
* then performs actions for -s option. */
xfree(opt_syslog_facility); // ignore any previous options sent
opt_syslog_facility = xstrdup(optValue);
+ _db_set_syslog(opt_syslog_facility);
+ break;
case 's':
/** \par s
* Initialize the syslog for output */
-#if HAVE_SYSLOG
-
_db_set_syslog(opt_syslog_facility);
-
break;
-#else
-
- fatal("Logging to syslog not available on this platform");
-
- /* NOTREACHED */
-#endif
-
case 'u':
/** \par u
* Store the ICP port number given in global option icpPortNumOverride
#endif
}
-void
+static void
master_revive_kids(int sig)
{
ReviveKidsSignal = sig;
}
/// Shutdown signal handler for master process
-void
+static void
master_shutdown(int sig)
{
do_shutdown = 1;
shutdown_status = EXIT_FAILURE;
#endif
-#if !_SQUID_WINDOWS_
-#if !HAVE_SIGACTION
+#if !defined(_SQUID_WINDOWS_) && !defined(HAVE_SIGACTION)
signal(sig, shut_down);
#endif
-#endif
}
void
{
do_handle_stopped_child = 1;
-#if !_SQUID_WINDOWS_
-#if !HAVE_SIGACTION
+#if !defined(_SQUID_WINDOWS_) && !defined(HAVE_SIGACTION)
signal(sig, sig_child);
-#endif
+#else
+ (void)sig;
#endif
}
int memInUse(mem_type);
void memDataInit(mem_type, const char *, size_t, int, bool doZero = true);
void memCheckInit(void);
+size_t memStringCount();
#endif /* _SQUID_SRC_MEM_FORWARD_H */
" MB");
}
-mem_type &operator++ (mem_type &aMem)
+static mem_type &
+operator++(mem_type &aMem)
{
int tmp = (int)aMem;
aMem = (mem_type)(++tmp);
*
* \note opaque string may be a list with a non-integer (e.g., "1,2,3,z")
*/
-Mgr::QueryParam::Pointer
+static Mgr::QueryParam::Pointer
ParseParamValue(const SBuf &rawValue)
{
static const CharacterSet comma("comma", ",");
#include "squid.h"
#include "Debug.h"
+#include "mime_header.h"
#include "profiler/Profiler.h"
+#include "sbuf/SBuf.h"
size_t
headersEnd(const char *mime, size_t l, bool &containsObsFold)
return 0;
}
+size_t
+headersEnd(const SBuf &buf, bool &containsObsFold)
+{
+ return headersEnd(buf.rawContent(), buf.length(), containsObsFold);
+}
+
#ifndef SQUID_MIME_HEADER_H_
#define SQUID_MIME_HEADER_H_
+#include "sbuf/forward.h"
+
+#include <cstddef>
+
/**
* Scan for the end of mime header block.
*
*/
size_t headersEnd(const char *, size_t, bool &containsObsFold);
-inline size_t
-headersEnd(const SBuf &buf, bool &containsObsFold)
-{
- return headersEnd(buf.rawContent(), buf.length(), containsObsFold);
-}
+size_t headersEnd(const SBuf &buf, bool &containsObsFold);
/// \deprecated caller needs to be fixed to handle obs-fold
inline size_t
/**
* Perform all actions when a CachePeer is detected revived.
*/
-void
+static void
peerAlive(CachePeer *p)
{
if (p->stats.logged_state == PEER_DEAD && p->tcp_up) {
debugs(15, 5, "peerDigestLookup: peer " << p->host << " says HIT!");
return LOOKUP_HIT;
-
+#else
+ (void)p;
+ (void)ps;
#endif
return LOOKUP_NONE;
best_p ? LOOKUP_HIT : (choice_count ? LOOKUP_MISS : LOOKUP_NONE));
request->hier.n_choices = choice_count;
request->hier.n_ichoices = ichoice_count;
+#else
+ (void)ps;
#endif
return best_p;
request->hier.cd_lookup = lookup;
debugs(15, 4, "peerNoteDigestLookup: peer " << (p? p->host : "<none>") << ", lookup: " << lookup_t_str[lookup] );
+#else
+ (void)request;
+ (void)p;
+ (void)lookup;
#endif
}
/* complete the digest transfer, update stats, unlock/release everything */
static void
-peerDigestReqFinish(DigestFetchState * fetch, char *buf,
+peerDigestReqFinish(DigestFetchState * fetch, char * /* buf */,
int fcb_valid, int pdcb_valid, int pcb_valid,
const char *reason, int err)
{
/* free fetch state structures
* must be called only when fetch cbdata is valid */
static void
-peerDigestFetchFinish(DigestFetchState * fetch, int err)
+peerDigestFetchFinish(DigestFetchState * fetch, int /* err */)
{
assert(fetch->entry && fetch->request);
#include "squid.h"
-#if HAVE_KRB5 && HAVE_GSSAPI
+#if HAVE_AUTH_MODULE_NEGOTIATE && HAVE_KRB5 && HAVE_GSSAPI
#if USE_APPLE_KRB5
#define KERBEROS_APPLE_DEPRECATED(x)
#define GSSKRB_APPLE_DEPRECATED(x)
#ifdef __cplusplus
}
#endif
-#endif /* HAVE_KRB5 && HAVE_GSSAPI */
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE && HAVE_KRB5 && HAVE_GSSAPI */
#include "acl/FilledChecklist.h"
#include "base/AsyncCbdataCalls.h"
#include "base/InstanceId.h"
+#include "base/TypeTraits.h"
#include "CachePeer.h"
#include "carp.h"
#include "client_side.h"
}
}
}
+#else
+ (void)header;
#endif /* USE_ICMP */
/* if closest-only is set, then don't allow FIRST_PARENT_MISS */
}
}
}
+#else
+ (void)htcp;
#endif /* USE_ICMP */
/* if closest-only is set, then don't allow FIRST_PARENT_MISS */
bool
PeerSelector::wantsMoreDestinations() const {
const auto maxCount = Config.forward_max_tries;
- return maxCount >= 0 && foundPaths <
- static_cast<std::make_unsigned<decltype(maxCount)>::type>(maxCount);
+ return maxCount >= 0 && foundPaths < static_cast<size_t>(maxCount);
}
void
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
+#include "peer_sourcehash.h"
#include "PeerSelectState.h"
#include "SquidConfig.h"
#include "Store.h"
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
+#include "peer_userhash.h"
#include "PeerSelectState.h"
#include "SquidConfig.h"
#include "Store.h"
#include "HttpRequest.h"
#include "MemObject.h"
#include "mgr/Registration.h"
+#include "refresh.h"
#include "RefreshPattern.h"
#include "SquidConfig.h"
#include "SquidTime.h"
}
static void
-heap_remove(RemovalPolicy * policy, StoreEntry * entry,
+heap_remove(RemovalPolicy * policy, StoreEntry *,
RemovalPolicyNode * node)
{
HeapPolicyData *h = (HeapPolicyData *)policy->_data;
echo " * do not edit"
echo " */"
echo "#include \"squid.h\""
+echo "#include \"repl_modules.h\""
echo "#include \"Store.h\""
echo ""
for module in "$@"; do
#if USE_OPENSSL
if (Ssl::ErrorDetailsManager::GetInstance().getErrorDetail(error_no, request, detailEntry))
format = detailEntry.detail.termedBuf();
+#else
+ (void)request;
#endif
if (!format)
format = "SSL handshake error (%err_name)";
return ioResult;
#else
+ (void)topError;
// TLS I/O code path should never be reachable without a TLS/SSL library.
debugs(1, DBG_CRITICAL, ForceAlert << "BUG: " <<
"Unexpected TLS I/O in Squid built without a TLS/SSL library");
" SSL version " << version_ <<
" negotiated cipher " << cipherName());
}
+#else
+ (void)session;
#endif
}
peerConnector_(pc) {}
/* CallDialer API */
- virtual bool canDial(AsyncCall &call) { return peerConnector_.valid(); }
- virtual void dial(AsyncCall &call) { ((&(*peerConnector_))->*method_)(object, status); }
+ virtual bool canDial(AsyncCall &) { return peerConnector_.valid(); }
+ virtual void dial(AsyncCall &) { ((&(*peerConnector_))->*method_)(object, status); }
Method method_; ///< The Security::PeerConnector method to dial
CbcPointer<Security::PeerConnector> peerConnector_; ///< The Security::PeerConnector object
};
/// Called when the SSL negotiation to the server completed and the certificates
/// validated using the cert validator.
/// \param error if not NULL the SSL negotiation was aborted with an error
- virtual void noteNegotiationDone(ErrorState *error) {}
+ virtual void noteNegotiationDone(ErrorState *) {}
/// Must implemented by the kid classes to return the TLS context object to use
/// for building the encryption context objects.
SSL_CTX_set_options(ctx.get(), parsedOptions);
#elif USE_GNUTLS
// NP: GnuTLS uses 'priorities' which are set only per-session instead.
+ (void)ctx;
+#else
+ (void)ctx;
#endif
}
#if USE_OPENSSL && defined(TLSEXT_TYPE_next_proto_neg)
// Dummy next_proto_neg callback
static int
-ssl_next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
+ssl_next_proto_cb(SSL *, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void * /* arg */)
{
static const unsigned char supported_protos[] = {8, 'h','t','t', 'p', '/', '1', '.', '1'};
(void)SSL_select_next_proto(out, outlen, in, inlen, supported_protos, sizeof(supported_protos));
#if USE_OPENSSL && defined(TLSEXT_TYPE_next_proto_neg)
SSL_CTX_set_next_proto_select_cb(ctx.get(), &ssl_next_proto_cb, nullptr);
-#endif
-
+#else
// NOTE: GnuTLS does not support the obsolete NPN extension.
// it does support ALPN per-session, not per-context.
+ (void)ctx;
+#endif
}
static const char *
X509_STORE_set_flags(st, X509_V_FLAG_CRL_CHECK);
#endif
+#else /* USE_OPENSSL */
+ (void)ctx;
#endif /* USE_OPENSSL */
}
#endif
#elif USE_GNUTLS
// Modern GnuTLS versions trust intermediate CA certificates by default.
+ (void)ctx;
+#else
+ (void)ctx;
#endif /* TLS library */
}
if (x != GNUTLS_E_SUCCESS) {
debugs(83, DBG_IMPORTANT, "ERROR: session=" << s << " Failed to set TLS options (" << errMsg << ":" << tlsMinVersion << "). error: " << Security::ErrorString(x));
}
+#else
+ (void)s;
#endif
}
}
bool
-Security::ServerOptions::createStaticServerContext(AnyP::PortCfg &port)
+Security::ServerOptions::createStaticServerContext(AnyP::PortCfg &)
{
updateTlsVersionLimits();
} else {
Ssl::DisablePeerVerification(ctx);
}
+#else
+ (void)ctx;
#endif
}
#else
debugs(83, DBG_CRITICAL, "ERROR: EECDH is not available in this build." <<
" Please link against OpenSSL>=0.9.8 and ensure OPENSSL_NO_ECDH is not set.");
+ (void)ctx;
#endif
}
#if USE_OPENSSL
if (!staticContextSessionId.isEmpty())
SSL_CTX_set_session_id_context(ctx.get(), reinterpret_cast<const unsigned char*>(staticContextSessionId.rawContent()), staticContextSessionId.length());
+#else
+ (void)ctx;
#endif
}
errAction = "failed to initialize session";
debugs(83, DBG_IMPORTANT, "TLS error: " << errAction << ": " << Security::ErrorString(errCode));
}
-#endif
+#endif /* USE_GNUTLS */
if (session) {
const int fd = conn->fd;
// this does the equivalent of SSL_set_fd() for now.
gnutls_transport_set_int(session.get(), fd);
gnutls_handshake_set_timeout(session.get(), GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
-#endif
+#endif /* USE_GNUTLS */
debugs(83, 5, "link FD " << fd << " to TLS session=" << (void*)session.get());
#if USE_OPENSSL
errCode = ERR_get_error();
errAction = "failed to initialize I/O";
+ (void)opts;
#elif USE_GNUTLS
errAction = "failed to assign credentials";
#endif
debugs(83, DBG_IMPORTANT, "ERROR: " << squidCtx << ' ' << errAction <<
": " << (errCode != 0 ? Security::ErrorString(errCode) : ""));
-#endif
+#else
+ (void)ctx;
+ (void)opts;
+ (void)type;
+ (void)squidCtx;
+#endif /* USE_OPENSSL || USE_GNUTLS */
return false;
}
#if USE_OPENSSL
static int
-store_session_cb(SSL *ssl, SSL_SESSION *session)
+store_session_cb(SSL *, SSL_SESSION *session)
{
if (!SessionCache)
return 0;
}
#endif /* USE_OPENSSL */
-void
+static void
initializeSessionCache()
{
#if USE_OPENSSL
#include <sys/file.h>
#endif
-#define HERE "(security_file_certgen) " << __FILE__ << ':' << __LINE__ << ": "
-
Ssl::Lock::Lock(std::string const &aFilename) :
filename(aFilename),
#if _SQUID_WINDOWS_
Ssl::Locker::~Locker()
{
+ (void)lineNo; // lineNo is unused but some find it helpful in debugging
if (weLocked)
lock.unlock();
}
-Ssl::CertificateDb::Row::Row()
- : width(cnlNumber)
+Ssl::CertificateDb::Row::Row() : width(cnlNumber)
{
row = (char **)OPENSSL_malloc(sizeof(char *) * (width + 1));
for (size_t i = 0; i < width + 1; ++i)
#include "squid.h"
#include "helper/protocol_defines.h"
#include "security/cert_generators/file/certificate_db.h"
+#include "SquidTime.h"
#include "ssl/crtd_message.h"
#include <cstring>
/// Get current time.
time_t getCurrentTime(void)
{
- struct timeval current_time;
+ struct timeval currentTime;
#if GETTIMEOFDAY_NO_TZP
- gettimeofday(¤t_time);
+ gettimeofday(¤tTime);
#else
- gettimeofday(¤t_time, NULL);
+ gettimeofday(¤tTime, nullptr);
#endif
- return current_time.tv_sec;
+ return currentTime.tv_sec;
}
/**
#elif USE_GNUTLS
return gnutls_strerror(code);
#else
+ (void)code;
return "[no TLS library]";
#endif
}
#include "globals.h"
#include "ICP.h"
#include "ipcache.h"
+#include "send-announce.h"
#include "SquidConfig.h"
#include "SquidTime.h"
#include "tools.h"
#include "servers/Http1Server.h"
#include "SquidConfig.h"
#include "Store.h"
+#include "tunnel.h"
CBDATA_NAMESPACED_CLASS_INIT(Http1, Server);
}
void clientProcessRequestFinished(ConnStateData *conn, const HttpRequest::Pointer &request);
-bool clientTunnelOnError(ConnStateData *conn, Http::StreamPointer &context, HttpRequest::Pointer &request, const HttpRequestMethod& method, err_type requestError);
bool
Http::One::Server::buildHttpRequest(Http::StreamPointer &context)
assert(http->log_uri);
const char * requestErrorBytes = inBuf.c_str();
- if (!clientTunnelOnError(this, context, request, parser_->method(), errPage)) {
+ if (!tunnelOnError(parser_->method(), errPage)) {
setReplyError(context, request, parser_->method(), errPage, parser_->parseStatusCode, requestErrorBytes);
// HttpRequest object not build yet, there is no reason to call
// clientProcessRequestFinished method
http->setLogUriToRawUri(http->uri, parser_->method());
const char * requestErrorBytes = inBuf.c_str();
- if (!clientTunnelOnError(this, context, request, parser_->method(), ERR_INVALID_URL)) {
+ if (!tunnelOnError(parser_->method(), ERR_INVALID_URL)) {
setReplyError(context, request, parser_->method(), ERR_INVALID_URL, Http::scBadRequest, requestErrorBytes);
// HttpRequest object not build yet, there is no reason to call
// clientProcessRequestFinished method
http->setLogUriToRawUri(http->uri, parser_->method());
const char * requestErrorBytes = NULL; //HttpParserHdrBuf(parser_);
- if (!clientTunnelOnError(this, context, request, parser_->method(), ERR_UNSUP_HTTPVERSION)) {
+ if (!tunnelOnError(parser_->method(), ERR_UNSUP_HTTPVERSION)) {
setReplyError(context, request, parser_->method(), ERR_UNSUP_HTTPVERSION, Http::scHttpVersionNotSupported, requestErrorBytes);
clientProcessRequestFinished(this, request);
}
// setReplyToError() requires log_uri
http->setLogUriToRawUri(http->uri, parser_->method());
const char * requestErrorBytes = NULL; //HttpParserHdrBuf(parser_);
- if (!clientTunnelOnError(this, context, request, parser_->method(), ERR_INVALID_REQ)) {
+ if (!tunnelOnError(parser_->method(), ERR_INVALID_REQ)) {
setReplyError(context, request, parser_->method(), ERR_INVALID_REQ, Http::scBadRequest, requestErrorBytes);
clientProcessRequestFinished(this, request);
}
return true;
}
-void switchToTunnel(HttpRequest *request, const Comm::ConnectionPointer &clientConn, const Comm::ConnectionPointer &srvConn, const SBuf &preReadServerData);
-
void
Http::One::Server::noteTakeServerConnectionControl(ServerConnectionContext server)
{
return (next);
}
-void
+static void
snmpAddNodeChild(mib_tree_entry *entry, mib_tree_entry *child)
{
debugs(49, 5, "snmpAddNodeChild: assigning " << child << " to parent " << entry);
if (errDetails != NULL && errDetails->getRecord(value, entry))
return true;
}
+#else
+ (void)request;
#endif
// else try the default
#include "ssl/bio.h"
#include "ssl/PeekingPeerConnector.h"
#include "ssl/ServerBump.h"
+#include "tunnel.h"
CBDATA_NAMESPACED_CLASS_INIT(Ssl, PeekingPeerConnector);
-void switchToTunnel(HttpRequest *request, const Comm::ConnectionPointer &clientConn, const Comm::ConnectionPointer &srvConn, const SBuf &preReadServerData);
-
void
Ssl::PeekingPeerConnector::cbCheckForPeekAndSpliceDone(Acl::Answer answer, void *data)
{
/// Called whenever the SSL connection state changes, an alert appears, or an
/// error occurs. See SSL_set_info_callback().
void
-Ssl::Bio::stateChanged(const SSL *ssl, int where, int ret)
+Ssl::Bio::stateChanged(const SSL *ssl, int where, int)
{
// Here we can use (where & STATE) to check the current state.
// Many STATE values are possible, including: SSL_CB_CONNECT_LOOP,
Bio(anFd),
holdRead_(false),
holdWrite_(false),
- helloSize(0),
abortReason(nullptr)
{
renegotiations.configure(10*1000);
ssl->s3->wpend_tot = mainHelloSize;
return true;
#else
+ (void)ssl;
+ (void)details;
+ (void)helloMessage;
return false;
#endif
}
/// Flushes any buffered data to socket.
/// The Ssl::Bio does not buffer any data, so this method has nothing to do
- virtual void flush(BIO *table) {}
+ virtual void flush(BIO *) {}
int fd() const { return fd_; } ///< The SSL socket descriptor
bool holdRead_; ///< The read hold state of the bio.
bool holdWrite_; ///< The write hold state of the bio.
- int helloSize; ///< The SSL hello message sent by client size
FadingCounter renegotiations; ///< client requested renegotiations limit control
/// why we should terminate the connection during next TLS operation (or nil)
}
bool
-Ssl::CertValidationMsg::parseResponse(CertValidationResponse &resp, std::string &error)
+Ssl::CertValidationMsg::parseResponse(CertValidationResponse &resp)
{
std::vector<CertItem> certs;
void composeRequest(CertValidationRequest const &vcert);
/// Parse a response message and fill the resp object with parsed information
- bool parseResponse(CertValidationResponse &resp, std::string &error);
+ bool parseResponse(CertValidationResponse &resp);
/// Search a CertItems list for the certificate with ID "name"
X509 *getCertByName(std::vector<CertItem> const &, std::string const & name);
sslCrtvdHandleReplyWrapper(void *data, const ::Helper::Reply &reply)
{
Ssl::CertValidationMsg replyMsg(Ssl::CrtdMessage::REPLY);
- std::string error;
submitData *crtdvdData = static_cast<submitData *>(data);
assert(crtdvdData->ssl.get());
debugs(83, DBG_IMPORTANT, "\"ssl_crtvd\" helper returned NULL response");
validationResponse->resultCode = ::Helper::BrokenHelper;
} else if (replyMsg.parse(reply.other().content(), reply.other().contentSize()) != Ssl::CrtdMessage::OK ||
- !replyMsg.parseResponse(*validationResponse, error) ) {
+ !replyMsg.parseResponse(*validationResponse) ) {
debugs(83, DBG_IMPORTANT, "WARNING: Reply from ssl_crtvd for " << " is incorrect");
debugs(83, DBG_IMPORTANT, "Certificate cannot be validated. ssl_crtvd response: " << replyMsg.getBody());
validationResponse->resultCode = ::Helper::BrokenHelper;
*/
int
-Ssl::AskPasswordCb(char *buf, int size, int rwflag, void *userdata)
+Ssl::AskPasswordCb(char *buf, int size, int /* rwflag */, void *userdata)
{
FILE *in;
int len = 0;
#if HAVE_LIBSSL_SSL_CTX_SET_TMP_RSA_CALLBACK
static RSA *
-ssl_temp_rsa_cb(SSL * ssl, int anInt, int keylen)
+ssl_temp_rsa_cb(SSL *, int, int keylen)
{
static RSA *rsa_512 = nullptr;
static RSA *rsa_1024 = nullptr;
#if HAVE_LIBSSL_SSL_CTX_SET_TMP_RSA_CALLBACK
debugs(83, 9, "Setting RSA key generation callback.");
SSL_CTX_set_tmp_rsa_callback(ctx.get(), ssl_temp_rsa_cb);
+#else
+ (void)ctx;
#endif
}
}
bool
-Ssl::InitServerContext(Security::ContextPointer &ctx, AnyP::PortCfg &port)
+Ssl::InitServerContext(Security::ContextPointer &ctx, AnyP::PortCfg &)
{
if (!ctx)
return false;
}
bool
-Ssl::configureSSL(SSL *ssl, CertificateProperties const &properties, AnyP::PortCfg &port)
+Ssl::configureSSL(SSL *ssl, CertificateProperties const &properties, AnyP::PortCfg &)
{
Security::CertPointer cert;
Security::PrivateKeyPointer pkey;
}
bool
-Ssl::configureSSLUsingPkeyAndCertFromMemory(SSL *ssl, const char *data, AnyP::PortCfg &port)
+Ssl::configureSSLUsingPkeyAndCertFromMemory(SSL *ssl, const char *data, AnyP::PortCfg &)
{
Security::CertPointer cert;
Security::PrivateKeyPointer pkey;
}
bool
-Ssl::verifySslCertificate(const Security::ContextPointer &ctx, CertificateProperties const &properties)
+Ssl::verifySslCertificate(const Security::ContextPointer &ctx, CertificateProperties const &)
{
#if HAVE_SSL_CTX_GET0_CERTIFICATE
X509 * cert = SSL_CTX_get0_certificate(ctx.get());
return 1;
}
-int
+static int
bio_sbuf_write(BIO* bio, const char* data, int len)
{
SBuf *buf = static_cast<SBuf *>(BIO_get_data(bio));
return len;
}
-int
-bio_sbuf_puts(BIO* bio, const char* data)
+static int
+bio_sbuf_puts(BIO *bio, const char *data)
{
// TODO: use bio_sbuf_write() instead
SBuf *buf = static_cast<SBuf *>(BIO_get_data(bio));
return buf->length() - oldLen;
}
-long
-bio_sbuf_ctrl(BIO* bio, int cmd, long num, void* ptr) {
+static long
+bio_sbuf_ctrl(BIO *bio, int cmd, long /* num */, void *)
+{
SBuf *buf = static_cast<SBuf *>(BIO_get_data(bio));
switch (cmd) {
case BIO_CTRL_RESET:
storeAppendPrintf(sentry, "\nMemory allocation statistics\n");
storeAppendPrintf(sentry, "%12s %15s %6s %12s\n","Alloc Size","Count","Delta","Alloc/sec");
malloc_statistics(info_get_mallstat, sentry);
+#else
+ (void)sentry;
#endif
}
bool
Store::Controller::allowCollapsing(StoreEntry *e, const RequestFlags &reqFlags,
- const HttpRequestMethod &reqMethod)
+ const HttpRequestMethod &)
{
const KeyScope keyScope = reqFlags.refresh ? ksRevalidation : ksDefault;
// set the flag now so that it gets copied into the Transients entry
if (storeClientListSearch(mem, data) != NULL)
/* XXX die! */
assert(1 == 0);
-
+#else
+ (void)data;
#endif
sc = new store_client (e);
{
#if STORE_CLIENT_LIST_DEBUG
assert(sc == storeClientListSearch(e->mem_obj, data));
+#else
+ (void)data;
#endif
assert(sc);
{
MemObject *mem = e->mem_obj;
#if STORE_CLIENT_LIST_DEBUG
-
assert(sc == storeClientListSearch(e->mem_obj, data));
+#else
+ (void)data;
#endif
if (mem == NULL)
debugs(71, 6, "storeDigestDel: deled entry, key: " << entry->getMD5Text());
}
}
+#else
+ (void)entry;
#endif //USE_CACHE_DIGESTS
}
} else {
storeAppendPrintf(e, "store digest: disabled.\n");
}
-
+#else
+ (void)e;
#endif //USE_CACHE_DIGESTS
}
/* rebuilds digest from scratch */
static void
-storeDigestRebuildStart(void *datanotused)
+storeDigestRebuildStart(void *)
{
assert(store_digest);
/* prevent overlapping if rebuild schedule is too tight */
/* recalculate a few hash buckets per invocation; schedules next step */
static void
-storeDigestRebuildStep(void *datanotused)
+storeDigestRebuildStep(void *)
{
/* TODO: call Store::Root().size() to determine this.. */
int count = Config.Store.objectsPerBucket * (int) ceil((double) store_hash_buckets *
/* starts swap out sequence for the digest */
static void
-storeDigestRewriteStart(void *datanotused)
+storeDigestRewriteStart(void *)
{
assert(store_digest);
/* prevent overlapping if rewrite schedule is too tight */
maxHayLength(40),
thePos(0),
thePlacement(placeEof),
- theStringPos(0),
theBareNeedlePos(0),
theFindString(0),
theFindSBuf(0),
SBuf theSBufNeedle; ///< the string to be found
SBuf::size_type thePos; ///< search position limit
Placement thePlacement; ///< where in the hay the needle is placed
- std::string::size_type theStringPos; ///< thePos converted to std::string::size_type
std::string theStringHay; ///< theHay converted to std::string
std::string theStringNeedle; ///< theNeedle converted to std::string
primaryEngine(NULL), loop_delay(0), error(false), runOnceResult(false)
STUB_NOP
- void EventLoop::registerEngine(AsyncEngine *engine) STUB
+ void EventLoop::registerEngine(AsyncEngine *) STUB
HttpHeader::HttpHeader(const http_hdr_owner_type) {STUB}
HttpHeader::HttpHeader(const HttpHeader &) {STUB}
HttpHeader::~HttpHeader() {STUB}
-HttpHeader &HttpHeader::operator =(const HttpHeader &other) STUB_RETVAL(*this)
+HttpHeader &HttpHeader::operator =(const HttpHeader &) STUB_RETVAL(*this)
void HttpHeader::clean() STUB
void HttpHeader::append(const HttpHeader *) STUB
void HttpHeader::update(const HttpHeader *) STUB
void HttpHeader::removeHopByHopEntries() STUB
void HttpHeader::removeConnectionHeaderEntries() STUB
bool HttpHeader::Isolate(const char **, size_t, const char **, const char **) STUB_RETVAL(false)
-bool HttpHeader::needUpdate(const HttpHeader *fresh) const STUB_RETVAL(false)
+bool HttpHeader::needUpdate(const HttpHeader *) const STUB_RETVAL(false)
bool HttpHeader::skipUpdateHeader(const Http::HdrType) const STUB_RETVAL(false)
void HttpHeader::updateWarnings() STUB
int httpHeaderParseQuotedString(const char *, const int, String *) STUB_RETVAL(-1)
protoPrefix("HTTP/"), do_clean(false), bodySizeMax(-2), content_range(nullptr)
{STUB_NOP}
HttpReply::~HttpReply() STUB
-void HttpReply::setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires_) STUB
+void HttpReply::setHeaders(Http::StatusCode, const char *, const char *, int64_t, time_t, time_t) STUB
void HttpReply::packHeadersUsingFastPacker(Packable&) const STUB
void HttpReply::packHeadersUsingSlowPacker(Packable&) const STUB
void HttpReply::reset() STUB
-void httpBodyPackInto(const HttpBody *, Packable *) STUB
-bool HttpReply::sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *error) STUB_RETVAL(false)
+bool HttpReply::sanityCheckStartLine(const char *, const size_t, Http::StatusCode *) STUB_RETVAL(false)
int HttpReply::httpMsgParseError() STUB_RETVAL(0)
bool HttpReply::expectingBody(const HttpRequestMethod&, int64_t&) const STUB_RETVAL(false)
-bool HttpReply::parseFirstLine(const char *start, const char *end) STUB_RETVAL(false)
+bool HttpReply::parseFirstLine(const char *, const char *) STUB_RETVAL(false)
void HttpReply::hdrCacheInit() STUB
HttpReply * HttpReply::clone() const STUB_RETVAL(NULL)
-bool HttpReply::inheritProperties(const Http::Message *aMsg) STUB_RETVAL(false)
+bool HttpReply::inheritProperties(const Http::Message *) STUB_RETVAL(false)
HttpReply::Pointer HttpReply::recreateOnNotModified(const HttpReply &) const STUB_RETVAL(nullptr)
int64_t HttpReply::bodySize(const HttpRequestMethod&) const STUB_RETVAL(0)
const HttpHdrContRange *HttpReply::contentRange() const STUB_RETVAL(nullptr)
void MemObject::trimSwappable() STUB
void MemObject::trimUnSwappable() STUB
-int64_t MemObject::policyLowestOffsetToKeep(bool swap) const STUB_RETVAL(-1)
+int64_t MemObject::policyLowestOffsetToKeep(bool) const STUB_RETVAL(-1)
MemObject::MemObject() {
ping_reply_callback = nullptr;
memset(&start_ping, 0, sizeof(start_ping));
const char *MemObject::storeId() const STUB_RETVAL(NULL)
const char *MemObject::logUri() const STUB_RETVAL(NULL)
-void MemObject::setUris(char const *aStoreId, char const *aLogUri, const HttpRequestMethod &aMethod) STUB
+void MemObject::setUris(char const *, char const *, const HttpRequestMethod &) STUB
void MemObject::reset() STUB
-void MemObject::delayRead(DeferredRead const &aRead) STUB
+void MemObject::delayRead(DeferredRead const &) STUB
bool MemObject::readAheadPolicyCanRead() const STUB_RETVAL(false)
-void MemObject::setNoDelay(bool const newValue) STUB
+void MemObject::setNoDelay(bool const) STUB
MemObject::~MemObject() STUB
-int MemObject::mostBytesWanted(int max, bool ignoreDelayPools) const STUB_RETVAL(-1)
+int MemObject::mostBytesWanted(int, bool) const STUB_RETVAL(-1)
#if USE_DELAY_POOLS
DelayId MemObject::mostBytesAllowed() const STUB_RETVAL(DelayId())
#endif
-void MemObject::write(const StoreIOBuffer &writeBuffer) STUB
+void MemObject::write(const StoreIOBuffer &) STUB
int64_t MemObject::lowestMemReaderOffset() const STUB_RETVAL(0)
void MemObject::kickReads() STUB
int64_t MemObject::objectBytesOnDisk() const STUB_RETVAL(0)
MemStore::MemStore() STUB
MemStore::~MemStore() STUB
bool MemStore::keepInLocalMemory(const StoreEntry &) const STUB_RETVAL(false)
-void MemStore::write(StoreEntry &e) STUB
-void MemStore::completeWriting(StoreEntry &e) STUB
-void MemStore::disconnect(StoreEntry &e) STUB
+void MemStore::write(StoreEntry &) STUB
+void MemStore::completeWriting(StoreEntry &) STUB
+void MemStore::disconnect(StoreEntry &) STUB
void MemStore::reference(StoreEntry &) STUB
void MemStore::updateHeaders(StoreEntry *) STUB
void MemStore::maintain() STUB
*/
#include "squid.h"
+#include "sbuf/DetailedStats.h"
#include "sbuf/SBuf.h"
+#include "StatHist.h"
#define STUB_API "sbuf/DetailedStats.cc"
#include "tests/STUB.h"
-class StatHist;
+static StatHist s;
void recordSBufSizeAtDestruct(SBuf::size_type) {} // STUB_NOP
-const StatHist * collectSBufDestructTimeStats() STUB_RETVAL(nullptr)
+StatHist &collectSBufDestructTimeStats() STUB_RETVAL(s)
void recordMemBlobSizeAtDestruct(SBuf::size_type) {} // STUB_NOP
-const StatHist * collectMemBlobDestructTimeStats() STUB_RETVAL(nullptr)
+StatHist &collectMemBlobDestructTimeStats() STUB_RETVAL(s)
class StoreEntry;
-void StatHist::dump(StoreEntry * sentry, StatHistBinDumper * bd) const STUB
-void StatHist::enumInit(unsigned int i) STUB_NOP
+void StatHist::dump(StoreEntry *, StatHistBinDumper *) const STUB
+void StatHist::enumInit(unsigned int) STUB_NOP
void StatHist::count(double) {/* STUB_NOP */}
-double statHistDeltaMedian(const StatHist & A, const StatHist & B) STUB_RETVAL(0.0)
-double statHistDeltaPctile(const StatHist & A, const StatHist & B, double pctile) STUB_RETVAL(0.0)
-void StatHist::logInit(unsigned int i, double d1, double d2) STUB_NOP
-void statHistIntDumper(StoreEntry * sentry, int idx, double val, double size, int count) STUB
+double statHistDeltaMedian(const StatHist &, const StatHist &) STUB_RETVAL(0.0)
+double statHistDeltaPctile(const StatHist & , const StatHist & , double) STUB_RETVAL(0.0)
+void StatHist::logInit(unsigned int, double, double) STUB_NOP
+void statHistIntDumper(StoreEntry *, int, double, double, int) STUB
#define STUB_API "UdsOp.cc"
#include "tests/STUB.h"
-void Ipc::SendMessage(const String& toAddress, const TypedMsgHdr& message) STUB
+void Ipc::SendMessage(const String&, const TypedMsgHdr&) STUB
#include "squid.h"
#include "acl/Acl.h"
+#include "acl/Gadgets.h"
#include "ConfigParser.h"
#include "wordlist.h"
#include "cache_cf.h"
void self_destruct(void) STUB
-void parse_int(int *var) STUB
-void parse_onoff(int *var) STUB
-void parse_eol(char *volatile *var) STUB
-void parse_wordlist(wordlist ** list) STUB
-void requirePathnameExists(const char *name, const char *path) STUB_NOP
-void parse_time_t(time_t * var) STUB
-void ConfigParser::ParseUShort(unsigned short *var) STUB
+void parse_int(int *) STUB
+void parse_onoff(int *) STUB
+void parse_eol(char *volatile *) STUB
+void parse_wordlist(wordlist **) STUB
+void requirePathnameExists(const char *, const char *) STUB_NOP
+void parse_time_t(time_t *) STUB
+void ConfigParser::ParseUShort(unsigned short *) STUB
void ConfigParser::ParseWordList(wordlist **) STUB
-void parseBytesOptionValue(size_t *, const char *, char const * value) STUB
-void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head) STUB
+void parseBytesOptionValue(size_t *, const char *, char const *) STUB
+void dump_acl_access(StoreEntry *, const char *, acl_access *) STUB
void dump_acl_list(StoreEntry*, ACLList*) STUB
#define STUB_API "cache_manager.cc"
#include "tests/STUB.h"
-Mgr::Action::Pointer CacheManager::createNamedAction(char const* action) STUB_RETVAL(NULL)
+Mgr::Action::Pointer CacheManager::createNamedAction(char const*) STUB_RETVAL(nullptr)
void CacheManager::start(const Comm::ConnectionPointer &, HttpRequest *, StoreEntry *, const AccessLogEntryPointer &)
{
std::cerr << HERE << "\n";
#define STUB_API "carp.cc"
#include "tests/STUB.h"
+#include "carp.h"
+
class CachePeer;
class PeerSelector;
void carpInit(void) STUB
-CachePeer *carpSelectParent(PeerSelector *ps) STUB_RETVAL(nullptr)
+CachePeer *carpSelectParent(PeerSelector *) STUB_RETVAL(nullptr)
void clientdbFreeMemory(void) STUB
int clientdbEstablished(const Ip::Address &, int) STUB_RETVAL(-1)
#if USE_DELAY_POOLS
-void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark) STUB
-ClientInfo *clientdbGetInfo(const Ip::Address &addr) STUB_RETVAL(nullptr)
+void clientdbSetWriteLimiter(ClientInfo *, const int,const double,const double) STUB
+ClientInfo *clientdbGetInfo(const Ip::Address &) STUB_RETVAL(nullptr)
#endif
#if SQUID_SNMP
Ip::Address *client_entry(Ip::Address *) STUB_RETVAL(nullptr)
const char *findTrailingHTTPVersion(const char *, const char *) STUB_RETVAL(NULL)
int varyEvaluateMatch(StoreEntry *, HttpRequest *) STUB_RETVAL(0)
void clientOpenListenSockets(void) STUB
-void clientHttpConnectionsClose(void) STUB
void httpRequestFree(void *) STUB
void clientPackRangeHdr(const HttpReplyPointer &, const HttpHdrRangeSpec *, String, MemBuf *) STUB
void clientPackTermBound(String, MemBuf *) STUB
*/
#include "squid.h"
+#include "comm.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
+// #include "comm/Read.h"
#include "fde.h"
#define STUB_API "comm.cc"
#include <ostream>
-void comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, IOCB *handler, void *handler_data) STUB
-void comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback) STUB
+// void comm_read(const Comm::ConnectionPointer &, char *, int, IOCB *, void *) STUB
+// void comm_read(const Comm::ConnectionPointer &, char*, int, AsyncCall::Pointer &) STUB
/* should be in stub_CommRead */
#include "CommRead.h"
CommRead::CommRead() STUB
DeferredReadManager::~DeferredReadManager() STUB
DeferredRead::DeferredRead(DeferrableRead *, void *, CommRead const &) STUB
-void DeferredReadManager::delayRead(DeferredRead const &aRead) STUB
-void DeferredReadManager::kickReads(int const count) STUB
+void DeferredReadManager::delayRead(DeferredRead const &) STUB
+void DeferredReadManager::kickReads(int const) STUB
#include "comm.h"
bool comm_iocallbackpending(void) STUB_RETVAL(false)
-int commSetNonBlocking(int fd) STUB_RETVAL(Comm::COMM_ERROR)
-int commUnsetNonBlocking(int fd) STUB_RETVAL(-1)
-void commSetCloseOnExec(int fd) STUB_NOP
-void _comm_close(int fd, char const *file, int line) STUB
-void old_comm_reset_close(int fd) STUB
-void comm_reset_close(const Comm::ConnectionPointer &conn) STUB
-int comm_connect_addr(int sock, const Ip::Address &addr) STUB_RETVAL(-1)
+int commSetNonBlocking(int) STUB_RETVAL(Comm::COMM_ERROR)
+int commUnsetNonBlocking(int) STUB_RETVAL(-1)
+void commSetCloseOnExec(int) STUB_NOP
+void _comm_close(int, char const *, int) STUB
+void old_comm_reset_close(int) STUB
+void comm_reset_close(const Comm::ConnectionPointer &) STUB
+int comm_connect_addr(int, const Ip::Address &) STUB_RETVAL(-1)
+
void comm_init(void) STUB
void comm_exit(void) STUB
-int comm_open(int, int, Ip::Address &, int, const char *note) STUB_RETVAL(-1)
-int comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags) STUB_RETVAL(-1)
-void comm_import_opened(const Comm::ConnectionPointer &, const char *note, struct addrinfo *AI) STUB
-int comm_open_listener(int sock_type, int proto, Ip::Address &addr, int flags, const char *note) STUB_RETVAL(-1)
-void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note) STUB
-int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *) STUB_RETVAL(-1)
-unsigned short comm_local_port(int fd) STUB_RETVAL(0)
-int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen) STUB_RETVAL(-1)
-void commCallCloseHandlers(int fd) STUB
-void commUnsetFdTimeout(int fd) STUB
-int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
-int commSetConnTimeout(const Comm::ConnectionPointer &conn, int seconds, AsyncCall::Pointer &callback) STUB_RETVAL(-1)
-int commUnsetConnTimeout(const Comm::ConnectionPointer &conn) STUB_RETVAL(-1)
-int ignoreErrno(int ierrno) STUB_RETVAL(-1)
+int comm_open(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
+int comm_open_uds(int, int, struct sockaddr_un*, int) STUB_RETVAL(-1)
+void comm_import_opened(const Comm::ConnectionPointer &, const char *, struct addrinfo *) STUB
+int comm_open_listener(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
+void comm_open_listener(int, int, Comm::ConnectionPointer &, const char *) STUB
+// int comm_openex(int, int, Ip::Address &, int, tos_t, nfmark_t, const char *) STUB_RETVAL(-1)
+unsigned short comm_local_port(int) STUB_RETVAL(0)
+int comm_udp_sendto(int, const Ip::Address &, const void *, int) STUB_RETVAL(-1)
+void commCallCloseHandlers(int) STUB
+void commUnsetFdTimeout(int) STUB
+// int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
+int commSetConnTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer &) STUB_RETVAL(-1)
+int commUnsetConnTimeout(const Comm::ConnectionPointer &) STUB_RETVAL(-1)
+int ignoreErrno(int) STUB_RETVAL(-1)
void commCloseAllSockets(void) STUB
void checkTimeouts(void) STUB
-AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *, void *) STUB
-void comm_add_close_handler(int fd, AsyncCall::Pointer &) STUB
-void comm_remove_close_handler(int fd, CLCB *, void *) STUB
-void comm_remove_close_handler(int fd, AsyncCall::Pointer &)STUB
-int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from) STUB_RETVAL(-1)
-int comm_udp_recv(int fd, void *buf, size_t len, int flags) STUB_RETVAL(-1)
-ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags) STUB_RETVAL(-1)
+AsyncCall::Pointer comm_add_close_handler(int, CLCB *, void *) STUB
+void comm_add_close_handler(int, AsyncCall::Pointer &) STUB
+void comm_remove_close_handler(int, CLCB *, void *) STUB
+void comm_remove_close_handler(int, AsyncCall::Pointer &)STUB
+int comm_udp_recvfrom(int, void *, size_t, int, Ip::Address &) STUB_RETVAL(-1)
+int comm_udp_recv(int, void *, size_t, int) STUB_RETVAL(-1)
+ssize_t comm_udp_send(int, const void *, size_t, int) STUB_RETVAL(-1)
bool comm_has_incomplete_write(int) STUB_RETVAL(false)
-void commStartHalfClosedMonitor(int fd) STUB
-bool commHasHalfClosedMonitor(int fd) STUB_RETVAL(false)
-int CommSelectEngine::checkEvents(int timeout) STUB_RETVAL(0)
+void commStartHalfClosedMonitor(int) STUB
+bool commHasHalfClosedMonitor(int) STUB_RETVAL(false)
+int CommSelectEngine::checkEvents(int) STUB_RETVAL(0)
static void
_db_print_stderr(const char *format, va_list args);
-void
+static void
_db_print(const char *format,...)
{
static char f[BUFSIZ];
#include "tests/STUB.h"
err_type errorReservePageId(const char *, const SBuf &) STUB_RETVAL(err_type(0))
-void errorAppendEntry(StoreEntry * entry, ErrorState * err) STUB
-bool strHdrAcptLangGetItem(const String &hdr, char *lang, int langLen, size_t &pos) STUB_RETVAL(false)
+void errorAppendEntry(StoreEntry *, ErrorState * ) STUB
+bool strHdrAcptLangGetItem(const String &, char *, int, size_t &) STUB_RETVAL(false)
void TemplateFile::loadDefault() STUB
TemplateFile::TemplateFile(char const*, err_type) STUB
bool TemplateFile::loadFor(const HttpRequest *) STUB_RETVAL(false)
#define STUB_API "event.cc"
#include "tests/STUB.h"
-void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata) STUB_NOP
-void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int) STUB
-void eventDelete(EVH * func, void *arg) STUB
+void eventAdd(const char *, EVH *, void *, double, int, bool) STUB_NOP
+void eventAddIsh(const char *, EVH *, void *, double, int) STUB
+void eventDelete(EVH *, void *) STUB
void eventInit(void) STUB
void eventFreeMemory(void) STUB
int eventFind(EVH *, void *) STUB_RETVAL(-1)
EventScheduler::EventScheduler() STUB
EventScheduler::~EventScheduler() STUB
-void EventScheduler::cancel(EVH * func, void * arg) STUB
+void EventScheduler::cancel(EVH *, void *) STUB
int EventScheduler::timeRemaining() const STUB_RETVAL(1)
void EventScheduler::clean() STUB
void EventScheduler::dump(StoreEntry *) STUB
-bool EventScheduler::find(EVH * func, void * arg) STUB_RETVAL(false)
-void EventScheduler::schedule(const char *name, EVH * func, void *arg, double when, int weight, bool cbdata) STUB
-int EventScheduler::checkEvents(int timeout) STUB_RETVAL(-1)
+bool EventScheduler::find(EVH *, void *) STUB_RETVAL(false)
+void EventScheduler::schedule(const char *, EVH *, void *, double, int, bool) STUB
+int EventScheduler::checkEvents(int) STUB_RETVAL(-1)
EventScheduler *EventScheduler::GetInstance() STUB_RETVAL(NULL)
*/
#include "squid.h"
+#include "fatal.h"
#define STUB_API "fatal.cc"
#include "tests/STUB.h"
void fatal(const char *) STUB
-void fatal_common(const char *) STUB
void fatalf(const char *, ...) STUB
-void fatalvf(const char *, va_list) STUB
void fatal_dump(const char *) STUB
*/
#include "squid.h"
+#include "fd.h"
#include "fde.h"
#define STUB_API "fd.cc"
fde *fde::Table = NULL;
int fdNFree(void) STUB_RETVAL(-1)
-void fd_open(int fd, unsigned int type, const char *desc) STUB
-void fd_close(int fd) STUB
-void fd_bytes(int fd, int len, unsigned int type) STUB
-void fd_note(int fd, const char *s) STUB
+void fd_open(int, unsigned int, const char *) STUB
+void fd_close(int) STUB
+void fd_bytes(int, int, unsigned int) STUB
+void fd_note(int, const char *) STUB
void fdAdjustReserved() STUB
#define STUB_API "helper.cc"
#include "tests/STUB.h"
-void helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data) STUB
-void helperStatefulSubmit(statefulhelper * hlp, const char *buf, HLPCB * callback, void *data, helper_stateful_server * lastserver) STUB
+void helperSubmit(helper *, const char *, HLPCB *, void *) STUB
+void helperStatefulSubmit(statefulhelper *, const char *, HLPCB *, void *, uint64_t) STUB
helper::~helper() STUB
CBDATA_CLASS_INIT(helper);
-void helper::packStatsInto(Packable *p, const char *label) const STUB
+void helper::packStatsInto(Packable *, const char *) const STUB
-void helperShutdown(helper * hlp) STUB
-void helperStatefulShutdown(statefulhelper * hlp) STUB
-void helperOpenServers(helper * hlp) STUB
-void helperStatefulOpenServers(statefulhelper * hlp) STUB
-helper_stateful_server *helperStatefulDefer(statefulhelper * hlp) STUB_RETVAL(NULL)
-void helperStatefulReleaseServer(helper_stateful_server * srv) STUB
+void helperShutdown(helper *) STUB
+void helperStatefulShutdown(statefulhelper *) STUB
+void helperOpenServers(helper *) STUB
+void helperStatefulOpenServers(statefulhelper *) STUB
CBDATA_CLASS_INIT(statefulhelper);
*/
#include "squid.h"
-#include "HttpReply.h"
-#include "HttpRequest.h"
+#include "http.h"
#include "sbuf/SBuf.h"
#define STUB_API "http.cc"
#include "tests/STUB.h"
+class HttpRequest;
+class HttpReply;
SBuf httpMakeVaryMark(HttpRequest *, HttpReply const *) STUB_RETVAL(SBuf())
#include "tests/STUB.h"
icp_common_t::icp_common_t() STUB
-icp_common_t::icp_common_t(char *buf, unsigned int len) STUB
-void icp_common_t::handleReply(char *buf, Ip::Address &from) STUB
-icp_common_t *icp_common_t::CreateMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad) STUB_RETVAL(nullptr)
+icp_common_t::icp_common_t(char *, unsigned int) STUB
+void icp_common_t::handleReply(char *, Ip::Address &) STUB
+icp_common_t *icp_common_t::CreateMessage(icp_opcode, int, const char *, int, int) STUB_RETVAL(nullptr)
icp_opcode icp_common_t::getOpCode() const STUB_RETVAL(ICP_INVALID)
-ICPState::ICPState(icp_common_t &aHeader, HttpRequest *aRequest) STUB
+ICPState::ICPState(icp_common_t &, HttpRequest *) STUB
ICPState::~ICPState() STUB
bool ICPState::confirmAndPrepHit(const StoreEntry &) const STUB_RETVAL(false)
LogTags *ICPState::loggingTags() const STUB_RETVAL(nullptr)
Comm::ConnectionPointer icpOutgoingConn;
Ip::Address theIcpPublicHostID;
-HttpRequest* icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from) STUB_RETVAL(NULL)
-bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request) STUB_RETVAL(false)
-void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from, AccessLogEntryPointer) STUB
+HttpRequest* icpGetRequest(char *, int, int, Ip::Address &) STUB_RETVAL(nullptr)
+bool icpAccessAllowed(Ip::Address &, HttpRequest *) STUB_RETVAL(false)
+void icpCreateAndSend(icp_opcode, int, char const *, int, int, int, const Ip::Address &, AccessLogEntryPointer) STUB
icp_opcode icpGetCommonOpcode() STUB_RETVAL(ICP_INVALID)
-void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd) STUB
+void icpDenyAccess(Ip::Address &, char *, int, int) STUB
void icpHandleIcpV3(int, Ip::Address &, char *, int) STUB
-void icpConnectionsOpen(void) STUB
void icpConnectionShutdown(void) STUB
-void icpConnectionClose(void) STUB
-int icpSetCacheKey(const cache_key * key) STUB_RETVAL(0)
-const cache_key *icpGetCacheKey(const char *url, int reqnum) STUB_RETVAL(NULL)
+int icpSetCacheKey(const cache_key *) STUB_RETVAL(0)
+const cache_key *icpGetCacheKey(const char *, int) STUB_RETVAL(nullptr)
#include "icp_opcode.h"
// dynamically generated
*/
#include "squid.h"
+#include "internal.h"
#define STUB_API "internal.cc"
#include "tests/STUB.h"
-char * internalLocalUri(const char *dir, const char *name) STUB_RETVAL(NULL)
+char *internalLocalUri(const char *, const SBuf &) STUB_RETVAL(nullptr)
#include "ipc/Forwarder.h"
//Avoid linker errors about Ipc::Forwarder
+void foo_stub_ipc_forwarder();
void foo_stub_ipc_forwarder()
{
Ipc::Forwarder foo(NULL,1.0);
#include "tests/STUB.h"
void ipcache_purgelru(void *) STUB
-void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData) STUB
-const ipcache_addrs *ipcache_gethostbyname(const char *, int flags) STUB_RETVAL(NULL)
+void ipcache_nbgethostbyname(const char *, IPH *, void *) STUB
+const ipcache_addrs *ipcache_gethostbyname(const char *, int) STUB_RETVAL(nullptr)
void ipcacheInvalidate(const char *) STUB
void ipcacheInvalidateNegative(const char *) STUB
void ipcache_init(void) STUB
-void ipcacheMarkBadAddr(const char *name, const Ip::Address &) STUB
-void ipcacheMarkGoodAddr(const char *name, const Ip::Address &) STUB
+void ipcacheMarkBadAddr(const char *, const Ip::Address &) STUB
+void ipcacheMarkGoodAddr(const char *, const Ip::Address &) STUB
void ipcacheFreeMemory(void) STUB
void ipcache_restart(void) STUB
-int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr) STUB_RETVAL(-1)
+int ipcacheAddEntryFromHosts(const char *, const char *) STUB_RETVAL(-1)
char *urlRInternal(const char *, unsigned short, const char *, const char *) STUB_RETVAL(nullptr)
char *urlInternal(const char *, const char *) STUB_RETVAL(nullptr)
int matchDomainName(const char *, const char *, enum MatchDomainNameFlags) STUB_RETVAL(0)
-int urlCheckRequest(const HttpRequest *) STUB_RETVAL(0)
+bool urlCheckRequest(const HttpRequest *) STUB_RETVAL(false)
void urlExtMethodConfigure() STUB
#include "auth/SchemeConfig.h"
namespace Auth
{
-Auth::UserRequest::Pointer SchemeConfig::CreateAuthUser(const char *, AccessLogEntry::Pointer &al) STUB_RETVAL(NULL)
+Auth::UserRequest::Pointer SchemeConfig::CreateAuthUser(const char *, AccessLogEntry::Pointer &) STUB_RETVAL(nullptr)
Auth::SchemeConfig * SchemeConfig::Find(const char *) STUB_RETVAL(NULL)
void SchemeConfig::registerWithCacheManager(void) STUB_NOP
Auth::ConfigVector TheConfig;
#include "comm/AcceptLimiter.h"
Comm::AcceptLimiter dummy;
Comm::AcceptLimiter & Comm::AcceptLimiter::Instance() STUB_RETVAL(dummy)
-void Comm::AcceptLimiter::defer(const Comm::TcpAcceptor::Pointer &afd) STUB
-void Comm::AcceptLimiter::removeDead(const Comm::TcpAcceptor::Pointer &afd) STUB
+void Comm::AcceptLimiter::defer(const Comm::TcpAcceptor::Pointer &) STUB
+void Comm::AcceptLimiter::removeDead(const Comm::TcpAcceptor::Pointer &) STUB
void Comm::AcceptLimiter::kick() STUB
#include "comm/Connection.h"
Comm::ConnectionPointer Comm::Connection::cloneDestinationDetails() const STUB_RETVAL(nullptr)
void Comm::Connection::close() STUB
CachePeer * Comm::Connection::getPeer() const STUB_RETVAL(NULL)
-void Comm::Connection::setPeer(CachePeer * p) STUB
+void Comm::Connection::setPeer(CachePeer *) STUB
ScopedId Comm::Connection::codeContextGist() const STUB_RETVAL(id.detach())
std::ostream &Comm::Connection::detailCodeContext(std::ostream &os) const STUB_RETVAL(os)
InstanceIdDefinitions(Comm::Connection, "conn", uint64_t);
#include "comm/IoCallback.h"
void Comm::IoCallback::setCallback(iocb_type, AsyncCall::Pointer &, char *, FREE *, int) STUB
void Comm::IoCallback::selectOrQueueWrite() STUB
- void Comm::IoCallback::cancel(const char *reason) STUB
- void Comm::IoCallback::finish(Comm::Flag code, int xerrn) STUB
+ void Comm::IoCallback::cancel(const char *) STUB
+ void Comm::IoCallback::finish(Comm::Flag, int) STUB
Comm::CbEntry *Comm::iocb_table = NULL;
void Comm::CallbackTableInit() STUB
void Comm::CallbackTableDestruct() STUB
void Comm::QuickPollRequired(void) STUB
#include "comm/Read.h"
-void Comm::Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback) STUB
-bool Comm::MonitorsRead(int fd) STUB_RETVAL(false)
-Comm::Flag Comm::ReadNow(CommIoCbParams ¶ms, SBuf &buf) STUB_RETVAL(Comm::COMM_ERROR)
-void Comm::ReadCancel(int fd, AsyncCall::Pointer &callback) STUB
+void Comm::Read(const Comm::ConnectionPointer &, AsyncCall::Pointer &) STUB
+bool Comm::MonitorsRead(int) STUB_RETVAL(false)
+Comm::Flag Comm::ReadNow(CommIoCbParams &, SBuf &) STUB_RETVAL(Comm::COMM_ERROR)
+void Comm::ReadCancel(int, AsyncCall::Pointer &) STUB
//void Comm::HandleRead(int, void*) STUB
-void comm_read_base(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback) STUB
-void comm_read_cancel(int fd, IOCB *callback, void *data) STUB
+void comm_read_base(const Comm::ConnectionPointer &, char *, int, AsyncCall::Pointer &) STUB
+void comm_read_cancel(int, IOCB *, void *) STUB
#include "comm/TcpAcceptor.h"
-//Comm::TcpAcceptor(const Comm::ConnectionPointer &conn, const char *note, const Subscription::Pointer &aSub) STUB
-void Comm::TcpAcceptor::subscribe(const Subscription::Pointer &aSub) STUB
+//Comm::TcpAcceptor(const Comm::ConnectionPointer &, const char *, const Subscription::Pointer &) STUB
+void Comm::TcpAcceptor::subscribe(const Subscription::Pointer &) STUB
void Comm::TcpAcceptor::unsubscribe(const char *) STUB
void Comm::TcpAcceptor::acceptNext() STUB
-void Comm::TcpAcceptor::notify(const Comm::Flag flag, const Comm::ConnectionPointer &) const STUB
+void Comm::TcpAcceptor::notify(const Comm::Flag, const Comm::ConnectionPointer &) const STUB
#include "comm/Tcp.h"
void Comm::ApplyTcpKeepAlive(int, const TcpKeepAlive &) STUB
#include "comm/Write.h"
void Comm::Write(const Comm::ConnectionPointer &, const char *, int, AsyncCall::Pointer &, FREE *) STUB
-void Comm::Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback) STUB
-void Comm::WriteCancel(const Comm::ConnectionPointer &conn, const char *reason) STUB
+void Comm::Write(const Comm::ConnectionPointer &, MemBuf *, AsyncCall::Pointer &) STUB
+void Comm::WriteCancel(const Comm::ConnectionPointer &, const char *) STUB
/*PF*/ void Comm::HandleWrite(int, void*) STUB
-std::ostream &operator << (std::ostream &os, const Comm::Connection &conn) STUB_RETVAL(os << "[Connection object]")
+std::ostream &operator << (std::ostream &os, const Comm::Connection &) STUB_RETVAL(os << "[Connection object]")
std::ostream &operator <<(std::ostream &os, const Error &) STUB_RETVAL(os)
-ErrorDetail::Pointer MakeNamedErrorDetail(const char *name) STUB_RETVAL(ErrorDetail::Pointer())
+ErrorDetail::Pointer MakeNamedErrorDetail(const char *) STUB_RETVAL(ErrorDetail::Pointer())
#include "eui/Eui48.h"
#if USE_SQUID_EUI
const unsigned char *Eui::Eui48::get(void) STUB_RETVAL(NULL)
-bool Eui::Eui48::decode(const char *asc) STUB_RETVAL(false)
-bool Eui::Eui48::encode(char *buf, const int len) const STUB_RETVAL(false)
-bool Eui::Eui48::lookup(const Ip::Address &c) STUB_RETVAL(false)
+bool Eui::Eui48::decode(const char *) STUB_RETVAL(false)
+bool Eui::Eui48::encode(char *, const int) const STUB_RETVAL(false)
+bool Eui::Eui48::lookup(const Ip::Address &) STUB_RETVAL(false)
#endif
#include "eui/Eui64.h"
#if USE_SQUID_EUI
const unsigned char *Eui::Eui64::get(void) STUB_RETVAL(NULL)
-bool Eui::Eui64::decode(const char *asc) STUB_RETVAL(false)
-bool Eui::Eui64::encode(char *buf, const int len) const STUB_RETVAL(false)
-bool Eui::Eui64::lookup(const Ip::Address &c) STUB_RETVAL(false)
-bool Eui::Eui64::lookupNdp(const Ip::Address &c) STUB_RETVAL(false)
-bool Eui::Eui64::lookupSlaac(const Ip::Address &c) STUB_RETVAL(false)
+bool Eui::Eui64::decode(const char *) STUB_RETVAL(false)
+bool Eui::Eui64::encode(char *, const int) const STUB_RETVAL(false)
+bool Eui::Eui64::lookup(const Ip::Address &) STUB_RETVAL(false)
+bool Eui::Eui64::lookupNdp(const Ip::Address &) STUB_RETVAL(false)
+bool Eui::Eui64::lookupSlaac(const Ip::Address &) STUB_RETVAL(false)
#endif
#define STUB_API "stub_libformat.cc"
#include "tests/STUB.h"
-void Format::Format::assemble(MemBuf &mb, const AccessLogEntryPointer &al, int logSequenceNumber) const STUB
+void Format::Format::assemble(MemBuf &, const AccessLogEntryPointer &, int) const STUB
bool Format::Format::parse(char const*) STUB_RETVAL(false)
Format::Format::Format(char const*) STUB
Format::Format::~Format() STUB
#include "http/RegisteredHeaders.h"
namespace Http
{
-HeaderTableRecord::HeaderTableRecord() {STUB_NOP}
HeaderTableRecord::HeaderTableRecord(const char *) {STUB_NOP}
HeaderTableRecord::HeaderTableRecord(const char *, Http::HdrType, Http::HdrFieldType, int) {STUB}
HeaderLookupTable_t::HeaderLookupTable_t() {STUB_NOP}
//IcmpSquid::~IcmpSquid() STUB
int IcmpSquid::Open() STUB_RETVAL(-1)
void IcmpSquid::Close() STUB
-void IcmpSquid::DomainPing(Ip::Address &to, const char *domain) STUB
+void IcmpSquid::DomainPing(Ip::Address &, const char *) STUB
#if USE_ICMP
-void IcmpSquid::SendEcho(Ip::Address &to, int opcode, const char* payload, int len) STUB
+void IcmpSquid::SendEcho(Ip::Address &, int, const char*, int) STUB
void IcmpSquid::Recv(void) STUB
#endif
//IcmpSquid icmpEngine;
#include "icmp/net_db.h"
void netdbInit(void) STUB
-void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt) STUB
-void netdbPingSite(const char *hostname) STUB
+void netdbHandlePingReply(const Ip::Address &, int, int) STUB
+void netdbPingSite(const char *) STUB
void netdbDump(StoreEntry *) STUB
void netdbFreeMemory(void) STUB
-int netdbHostHops(const char *host) STUB_RETVAL(-1)
-int netdbHostRtt(const char *host) STUB_RETVAL(-1)
+int netdbHostHops(const char *) STUB_RETVAL(-1)
+int netdbHostRtt(const char *) STUB_RETVAL(-1)
void netdbUpdatePeer(const AnyP::Uri &, CachePeer *, int, int) STUB
-void netdbDeleteAddrNetwork(Ip::Address &addr) STUB
+void netdbDeleteAddrNetwork(Ip::Address &) STUB
void netdbBinaryExchange(StoreEntry *) STUB
void netdbExchangeStart(void *) STUB
void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double) STUB
CachePeer *netdbClosestParent(PeerSelector *) STUB_RETVAL(nullptr)
-void netdbHostData(const char *host, int *samp, int *rtt, int *hops) STUB
+void netdbHostData(const char *, int *, int *, int *) STUB
#include "squid.h"
#include "fde.h"
+#include "log/File.h"
#define STUB_API "log/liblog.la"
#include "tests/STUB.h"
#include "log/access_log.h"
void fvdbCountVia(const SBuf &) STUB
-void fvdbCountForward(const SBuf &) STUB
#if HEADERS_LOG
void headersLog(int, int, const HttpRequestMethod &, void *) STUB
#endif
Logfile *logfileOpen(const char *, size_t, int) STUB_RETVAL(nullptr)
void logfileClose(Logfile *) STUB
void logfileRotate(Logfile *, int16_t) STUB
-void logfileWrite(Logfile *, char *, size_t) STUB
+void logfileWrite(Logfile *, const char *, size_t) STUB
void logfileFlush(Logfile *) STUB
void logfilePrintf(Logfile *, const char *, ...) STUB
void logfileLineStart(Logfile *) STUB
#include "tests/STUB.h"
#include "mem/AllocatorProxy.h"
+#include "mem/forward.h"
+
void *Mem::AllocatorProxy::alloc() {return xmalloc(64*1024);}
void Mem::AllocatorProxy::freeOne(void *address) {xfree(address);}
int Mem::AllocatorProxy::inUseCount() const {return 0;}
void Mem::Init() STUB_NOP
void Mem::Report() STUB_NOP
void Mem::Stats(StoreEntry *) STUB_NOP
-void CleanIdlePools(void *) STUB_NOP
-void Report(std::ostream &) STUB_NOP
-void PoolReport(const MemPoolStats *, const MemPoolMeter *, std::ostream &) STUB_NOP
+void Mem::CleanIdlePools(void *) STUB_NOP
+void Mem::Report(std::ostream &) STUB_NOP
+void Mem::PoolReport(const MemPoolStats *, const MemPoolMeter *, std::ostream &) STUB_NOP
//const size_t squidSystemPageSize = 4096;
void memClean(void) STUB
void memInitModule(void) STUB
void memCleanModule(void) STUB
void memConfigure(void) STUB
-void * memAllocate(mem_type)
+void *memAllocate(mem_type)
{
// let's waste plenty of memory. This should cover any possible need
return xmalloc(64*1024);
// NP: used by Action.h instantiations
#include "mgr/Command.h"
-std::ostream &operator <<(std::ostream &os, const Mgr::Command &cmd) STUB_RETVAL(os)
+std::ostream &operator <<(std::ostream &os, const Mgr::Command &) STUB_RETVAL(os)
#include "mgr/Action.h"
-Mgr::Action::Action(const CommandPointer &aCmd) STUB
+Mgr::Action::Action(const CommandPointer &) STUB
Mgr::Action::~Action() STUB
-void Mgr::Action::run(StoreEntry *entry, bool writeHttpHeader) STUB
-void Mgr::Action::fillEntry(StoreEntry *entry, bool writeHttpHeader) STUB
-void Mgr::Action::add(const Action &action) STUB
-void Mgr::Action::respond(const Request &request) STUB
+void Mgr::Action::run(StoreEntry *, bool) STUB
+void Mgr::Action::fillEntry(StoreEntry *, bool) STUB
+void Mgr::Action::add(const Action &) STUB
+void Mgr::Action::respond(const Request &) STUB
void Mgr::Action::sendResponse(const Ipc::RequestId) STUB
bool Mgr::Action::atomic() const STUB_RETVAL(false)
const char * Mgr::Action::name() const STUB_RETVAL(NULL)
#include "mgr/ActionParams.h"
Mgr::ActionParams::ActionParams() STUB_NOP
-Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &msg) STUB_NOP
-void Mgr::ActionParams::pack(Ipc::TypedMsgHdr &msg) const STUB
-std::ostream &operator <<(std::ostream &os, const Mgr::ActionParams ¶ms) STUB_RETVAL(os)
+Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &) STUB_NOP
+void Mgr::ActionParams::pack(Ipc::TypedMsgHdr &) const STUB
+std::ostream &operator <<(std::ostream &os, const Mgr::ActionParams &) STUB_RETVAL(os)
#include "mgr/ActionWriter.h"
-//Mgr::ActionWriter::ActionWriter(const Action::Pointer &anAction, int aFd) STUB
+//Mgr::ActionWriter::ActionWriter(const Action::Pointer &, int) STUB
//protected:
void Mgr::ActionWriter::start() STUB
#include "mgr/BasicActions.h"
-Mgr::Action::Pointer Mgr::MenuAction::Create(const Mgr::CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::MenuAction::dump(StoreEntry *entry) STUB
+Mgr::Action::Pointer Mgr::MenuAction::Create(const Mgr::CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::MenuAction::dump(StoreEntry *) STUB
//protected:
//Mgr::MenuAction::MenuAction(const CommandPointer &cmd) STUB
-Mgr::Action::Pointer Mgr::ShutdownAction::Create(const Mgr::CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::ShutdownAction::dump(StoreEntry *entry) STUB
+Mgr::Action::Pointer Mgr::ShutdownAction::Create(const Mgr::CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::ShutdownAction::dump(StoreEntry *) STUB
// protected:
-//Mgr::ShutdownAction::ShutdownAction(const CommandPointer &cmd) STUB
+//Mgr::ShutdownAction::ShutdownAction(const CommandPointer &) STUB
-Mgr::Action::Pointer Mgr::ReconfigureAction::Create(const Mgr::CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::ReconfigureAction::dump(StoreEntry *entry) STUB
+Mgr::Action::Pointer Mgr::ReconfigureAction::Create(const Mgr::CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::ReconfigureAction::dump(StoreEntry *) STUB
//protected:
-//Mgr::ReconfigureAction::ReconfigureAction(const CommandPointer &cmd) STUB
+//Mgr::ReconfigureAction::ReconfigureAction(const CommandPointer &) STUB
-Mgr::Action::Pointer Mgr::RotateAction::Create(const Mgr::CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::RotateAction::dump(StoreEntry *entry) STUB
+Mgr::Action::Pointer Mgr::RotateAction::Create(const Mgr::CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::RotateAction::dump(StoreEntry *) STUB
//protected:
-//Mgr::RotateAction::RotateAction(const CommandPointer &cmd) STUB
+//Mgr::RotateAction::RotateAction(const CommandPointer &) STUB
-Mgr::Action::Pointer Mgr::OfflineToggleAction::Create(const CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::OfflineToggleAction::dump(StoreEntry *entry) STUB
+Mgr::Action::Pointer Mgr::OfflineToggleAction::Create(const CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::OfflineToggleAction::dump(StoreEntry *) STUB
//protected:
-//Mgr::OfflineToggleAction::OfflineToggleAction(const CommandPointer &cmd) STUB
+//Mgr::OfflineToggleAction::OfflineToggleAction(const CommandPointer &) STUB
void Mgr::RegisterBasics() STUB
#include "mgr/CountersAction.h"
//Mgr::CountersActionData::CountersActionData() STUB
-Mgr::CountersActionData& Mgr::CountersActionData::operator +=(const Mgr::CountersActionData& stats) STUB_RETVAL(*this)
+Mgr::CountersActionData& Mgr::CountersActionData::operator +=(const Mgr::CountersActionData&) STUB_RETVAL(*this)
-Mgr::Action::Pointer Mgr::CountersAction::Create(const CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::CountersAction::add(const Action& action) STUB
-void Mgr::CountersAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::CountersAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::Action::Pointer Mgr::CountersAction::Create(const CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::CountersAction::add(const Action &) STUB
+void Mgr::CountersAction::pack(Ipc::TypedMsgHdr &) const STUB
+void Mgr::CountersAction::unpack(const Ipc::TypedMsgHdr &) STUB
//protected:
-//Mgr::CountersAction::CountersAction(const CommandPointer &cmd) STUB
+//Mgr::CountersAction::CountersAction(const CommandPointer &) STUB
void Mgr::CountersAction::collect() STUB
-void Mgr::CountersAction::dump(StoreEntry* entry) STUB
+void Mgr::CountersAction::dump(StoreEntry *) STUB
#include "mgr/Filler.h"
-//Mgr::Filler::Filler(const Action::Pointer &anAction, int aFd, unsigned int aRequestId) STUB
+//Mgr::Filler::Filler(const Action::Pointer &, int, unsigned int) STUB
//protected:
//void Mgr::Filler::start() STUB
//void Mgr::Filler::swanSong() STUB
#include "mgr/Forwarder.h"
-//Mgr::Forwarder::Forwarder(int aFd, const ActionParams &aParams, HttpRequest* aRequest, StoreEntry* anEntry) STUB
+//Mgr::Forwarder::Forwarder(int, const ActionParams &, HttpRequest *, StoreEntry *) STUB
//Mgr::Forwarder::~Forwarder() STUB
//protected:
//void Mgr::Forwarder::swanSong() STUB
void Mgr::Forwarder::handleError() STUB
void Mgr::Forwarder::handleTimeout() STUB
-void Mgr::Forwarder::handleException(const std::exception& e) STUB
+void Mgr::Forwarder::handleException(const std::exception &) STUB
#include "mgr/FunAction.h"
-Mgr::Action::Pointer Mgr::FunAction::Create(const CommandPointer &cmd, OBJH *aHandler) STUB_RETVAL(dummyAction)
-void Mgr::FunAction::respond(const Request& request) STUB
+Mgr::Action::Pointer Mgr::FunAction::Create(const CommandPointer &, OBJH *) STUB_RETVAL(dummyAction)
+void Mgr::FunAction::respond(const Request &) STUB
//protected:
-//Mgr::FunAction::FunAction(const CommandPointer &cmd, OBJH *aHandler) STUB
-void Mgr::FunAction::dump(StoreEntry *entry) STUB
+//Mgr::FunAction::FunAction(const CommandPointer &, OBJH *) STUB
+void Mgr::FunAction::dump(StoreEntry *) STUB
#include "mgr/InfoAction.h"
//Mgr::InfoActionData::InfoActionData() STUB
-Mgr::InfoActionData& Mgr::InfoActionData::operator += (const Mgr::InfoActionData& stats) STUB_RETVAL(*this)
+Mgr::InfoActionData& Mgr::InfoActionData::operator += (const Mgr::InfoActionData &) STUB_RETVAL(*this)
-Mgr::Action::Pointer Mgr::InfoAction::Create(const CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::InfoAction::add(const Action& action) STUB
-void Mgr::InfoAction::respond(const Request& request) STUB
-void Mgr::InfoAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::InfoAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::Action::Pointer Mgr::InfoAction::Create(const CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::InfoAction::add(const Action &) STUB
+void Mgr::InfoAction::respond(const Request &) STUB
+void Mgr::InfoAction::pack(Ipc::TypedMsgHdr &) const STUB
+void Mgr::InfoAction::unpack(const Ipc::TypedMsgHdr &) STUB
//protected:
-//Mgr::InfoAction::InfoAction(const Mgr::CommandPointer &cmd) STUB
+//Mgr::InfoAction::InfoAction(const Mgr::CommandPointer &) STUB
void Mgr::InfoAction::collect() STUB
-void Mgr::InfoAction::dump(StoreEntry* entry) STUB
+void Mgr::InfoAction::dump(StoreEntry *) STUB
#include "mgr/Inquirer.h"
-//Mgr::Inquirer::Inquirer(Action::Pointer anAction, const Request &aCause, const Ipc::StrandCoords &coords) STUB
+//Mgr::Inquirer::Inquirer(Action::Pointer, const Request &, const Ipc::StrandCoords &) STUB
//protected:
void Mgr::Inquirer::start() STUB
bool Mgr::Inquirer::doneAll() const STUB_RETVAL(false)
void Mgr::Inquirer::cleanup() STUB
void Mgr::Inquirer::sendResponse() STUB
-bool Mgr::Inquirer::aggregate(Ipc::Response::Pointer aResponse) STUB_RETVAL(false)
+bool Mgr::Inquirer::aggregate(Ipc::Response::Pointer) STUB_RETVAL(false)
#include "mgr/IntervalAction.h"
//Mgr::IntervalActionData::IntervalActionData() STUB
-Mgr::IntervalActionData& Mgr::IntervalActionData::operator +=(const Mgr::IntervalActionData& stats) STUB_RETVAL(*this)
+Mgr::IntervalActionData& Mgr::IntervalActionData::operator +=(const Mgr::IntervalActionData &) STUB_RETVAL(*this)
//Mgr::Action::Pointer Mgr::IntervalAction::Create5min(const CommandPointer &cmd) STUB_RETVAL(new Mgr::IntervalAction(*cmd))
//Mgr::Action::Pointer Mgr::IntervalAction::Create60min(const CommandPointer &cmd) STUB_RETVAL(new Mgr::IntervalAction(*cmd))
-void Mgr::IntervalAction::add(const Action& action) STUB
-void Mgr::IntervalAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::IntervalAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+void Mgr::IntervalAction::add(const Action&) STUB
+void Mgr::IntervalAction::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::IntervalAction::unpack(const Ipc::TypedMsgHdr&) STUB
//protected:
-//Mgr::IntervalAction::IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours) STUB
+//Mgr::IntervalAction::IntervalAction(const CommandPointer &, int, int) STUB
void Mgr::IntervalAction::collect() STUB
-void Mgr::IntervalAction::dump(StoreEntry* entry) STUB
+void Mgr::IntervalAction::dump(StoreEntry*) STUB
#include "mgr/IntParam.h"
//Mgr::IntParam::IntParam() STUB
-//Mgr::IntParam::IntParam(const std::vector<int>& anArray) STUB
-void Mgr::IntParam::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::IntParam::unpackValue(const Ipc::TypedMsgHdr& msg) STUB
+//Mgr::IntParam::IntParam(const std::vector<int>&) STUB
+void Mgr::IntParam::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::IntParam::unpackValue(const Ipc::TypedMsgHdr&) STUB
static std::vector<int> static_vector;
const std::vector<int>& Mgr::IntParam::value() const STUB_RETVAL(static_vector)
#include "mgr/IoAction.h"
//Mgr::IoActionData::IoActionData() STUB
-Mgr::IoActionData& Mgr::IoActionData::operator += (const IoActionData& stats) STUB_RETVAL(*this)
+Mgr::IoActionData& Mgr::IoActionData::operator += (const IoActionData&) STUB_RETVAL(*this)
-Mgr::Action::Pointer Mgr::IoAction::Create(const CommandPointer &cmd) STUB_RETVAL(dummyAction)
-void Mgr::IoAction::add(const Action& action) STUB
-void Mgr::IoAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::IoAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::Action::Pointer Mgr::IoAction::Create(const CommandPointer &) STUB_RETVAL(dummyAction)
+void Mgr::IoAction::add(const Action&) STUB
+void Mgr::IoAction::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::IoAction::unpack(const Ipc::TypedMsgHdr&) STUB
//protected:
-//Mgr::IoAction::IoAction(const CommandPointer &cmd) STUB
+//Mgr::IoAction::IoAction(const CommandPointer &) STUB
void Mgr::IoAction::collect() STUB
-void Mgr::IoAction::dump(StoreEntry* entry) STUB
+void Mgr::IoAction::dump(StoreEntry*) STUB
//#include "mgr/QueryParam.h"
-//void Mgr::QueryParam::pack(Ipc::TypedMsgHdr& msg) const = 0;
-//void Mgr::QueryParam::unpackValue(const Ipc::TypedMsgHdr& msg) = 0;
+//void Mgr::QueryParam::pack(Ipc::TypedMsgHdr&) const = 0;
+//void Mgr::QueryParam::unpackValue(const Ipc::TypedMsgHdr&) = 0;
#include "mgr/QueryParams.h"
-Mgr::QueryParam::Pointer Mgr::QueryParams::get(const String& name) const STUB_RETVAL(Mgr::QueryParam::Pointer(NULL))
-void Mgr::QueryParams::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::QueryParams::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::QueryParam::Pointer Mgr::QueryParams::get(const String&) const STUB_RETVAL(Mgr::QueryParam::Pointer(nullptr))
+void Mgr::QueryParams::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::QueryParams::unpack(const Ipc::TypedMsgHdr&) STUB
void Mgr::QueryParams::Parse(Parser::Tokenizer &, QueryParams &) STUB
//private:
-//Params::const_iterator Mgr::QueryParams::find(const String& name) const STUB_RETVAL(new Mgr::Params::const_iterator(*this))
-Mgr::QueryParam::Pointer Mgr::QueryParams::CreateParam(QueryParam::Type aType) STUB_RETVAL(Mgr::QueryParam::Pointer(NULL))
+//Params::const_iterator Mgr::QueryParams::find(const String&) const STUB_RETVAL(new Mgr::Params::const_iterator(*this))
+Mgr::QueryParam::Pointer Mgr::QueryParams::CreateParam(QueryParam::Type) STUB_RETVAL(Mgr::QueryParam::Pointer(NULL))
#include "mgr/Registration.h"
-//void Mgr::RegisterAction(char const * action, char const * desc, OBJH * handler, int pw_req_flag, int atomic);
-//void Mgr::RegisterAction(char const * action, char const * desc, ClassActionCreationHandler *handler, int pw_req_flag, int atomic);
+//void Mgr::RegisterAction(char const *, char const *, OBJH *, int, int);
+//void Mgr::RegisterAction(char const *, char const *, ClassActionCreationHandler *, int, int);
#include "mgr/Request.h"
-//Mgr::Request::Request(int aRequestorId, unsigned int aRequestId, int aFd, const Mgr::ActionParams &aParams) STUB
-//Mgr::Request::Request(const Ipc::TypedMsgHdr& msg) STUB
-void Mgr::Request::pack(Ipc::TypedMsgHdr& msg) const STUB
+//Mgr::Request::Request(int, unsigned int, int, const Mgr::ActionParams &) STUB
+//Mgr::Request::Request(const Ipc::TypedMsgHdr&) STUB
+void Mgr::Request::pack(Ipc::TypedMsgHdr&) const STUB
Ipc::Request::Pointer Mgr::Request::clone() const STUB_RETVAL(const_cast<Mgr::Request*>(this))
#include "mgr/Response.h"
-//Mgr::Response::Response(unsigned int aRequestId, Action::Pointer anAction = NULL) STUB
-//Mgr::Response::Response(const Ipc::TypedMsgHdr& msg) STUB
-void Mgr::Response::pack(Ipc::TypedMsgHdr& msg) const STUB
+//Mgr::Response::Response(unsigned int, Action::Pointer) STUB
+//Mgr::Response::Response(const Ipc::TypedMsgHdr&) STUB
+void Mgr::Response::pack(Ipc::TypedMsgHdr&) const STUB
static Ipc::Response::Pointer ipr_static;
Ipc::Response::Pointer Mgr::Response::clone() const STUB_RETVAL(Ipc::Response::Pointer(NULL))
bool Mgr::Response::hasAction() const STUB_RETVAL(false)
#include "mgr/ServiceTimesAction.h"
//Mgr::ServiceTimesActionData::ServiceTimesActionData() STUB
-Mgr::ServiceTimesActionData& Mgr::ServiceTimesActionData::operator +=(const Mgr::ServiceTimesActionData& stats) STUB_RETVAL(*this)
+Mgr::ServiceTimesActionData& Mgr::ServiceTimesActionData::operator +=(const Mgr::ServiceTimesActionData&) STUB_RETVAL(*this)
-Mgr::Action::Pointer Mgr::ServiceTimesAction::Create(const Mgr::CommandPointer &cmd) STUB_RETVAL(Mgr::Action::Pointer(NULL))
-void Mgr::ServiceTimesAction::add(const Action& action) STUB
-void Mgr::ServiceTimesAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::ServiceTimesAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::Action::Pointer Mgr::ServiceTimesAction::Create(const Mgr::CommandPointer &) STUB_RETVAL(Mgr::Action::Pointer(nullptr))
+void Mgr::ServiceTimesAction::add(const Action&) STUB
+void Mgr::ServiceTimesAction::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::ServiceTimesAction::unpack(const Ipc::TypedMsgHdr&) STUB
//protected:
-//Mgr::ServiceTimesAction::ServiceTimesAction(const CommandPointer &cmd) STUB
+//Mgr::ServiceTimesAction::ServiceTimesAction(const CommandPointer &) STUB
void Mgr::ServiceTimesAction::collect() STUB
-void Mgr::ServiceTimesAction::dump(StoreEntry* entry) STUB
+void Mgr::ServiceTimesAction::dump(StoreEntry*) STUB
#include "mgr/StoreIoAction.h"
//Mgr::StoreIoActionData::StoreIoActionData() STUB
-Mgr::StoreIoActionData & Mgr::StoreIoActionData::operator +=(const StoreIoActionData& stats) STUB_RETVAL(*this)
-//Mgr::StoreIoAction::StoreIoAction(const CommandPointer &cmd) STUB
-Mgr::Action::Pointer Mgr::StoreIoAction::Create(const CommandPointer &cmd) STUB_RETVAL(Mgr::Action::Pointer(NULL))
-void Mgr::StoreIoAction::add(const Action& action) STUB
-void Mgr::StoreIoAction::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::StoreIoAction::unpack(const Ipc::TypedMsgHdr& msg) STUB
+Mgr::StoreIoActionData & Mgr::StoreIoActionData::operator +=(const StoreIoActionData&) STUB_RETVAL(*this)
+//Mgr::StoreIoAction::StoreIoAction(const CommandPointer &) STUB
+Mgr::Action::Pointer Mgr::StoreIoAction::Create(const CommandPointer &) STUB_RETVAL(Mgr::Action::Pointer(nullptr))
+void Mgr::StoreIoAction::add(const Action&) STUB
+void Mgr::StoreIoAction::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::StoreIoAction::unpack(const Ipc::TypedMsgHdr&) STUB
void Mgr::StoreIoAction::collect() STUB
-void Mgr::StoreIoAction::dump(StoreEntry* entry) STUB
+void Mgr::StoreIoAction::dump(StoreEntry*) STUB
#include "mgr/StoreToCommWriter.h"
-//Mgr::StoreToCommWriter::StoreToCommWriter(int aFd, StoreEntry *anEntry) STUB
+//Mgr::StoreToCommWriter::StoreToCommWriter(int, StoreEntry *) STUB
Mgr::StoreToCommWriter::~StoreToCommWriter() STUB
void Mgr::StoreToCommWriter::start() STUB
void Mgr::StoreToCommWriter::swanSong() STUB
bool Mgr::StoreToCommWriter::doneAll() const STUB_RETVAL(false)
void Mgr::StoreToCommWriter::scheduleStoreCopy() STUB
-void Mgr::StoreToCommWriter::noteStoreCopied(StoreIOBuffer ioBuf) STUB
-void Mgr::StoreToCommWriter::NoteStoreCopied(void* data, StoreIOBuffer ioBuf) STUB
+void Mgr::StoreToCommWriter::noteStoreCopied(StoreIOBuffer) STUB
+void Mgr::StoreToCommWriter::NoteStoreCopied(void*, StoreIOBuffer) STUB
void Mgr::StoreToCommWriter::HandleStoreAbort(StoreToCommWriter *) STUB
-void Mgr::StoreToCommWriter::scheduleCommWrite(const StoreIOBuffer& ioBuf) STUB
-void Mgr::StoreToCommWriter::noteCommWrote(const CommIoCbParams& params) STUB
-void Mgr::StoreToCommWriter::noteCommClosed(const CommCloseCbParams& params) STUB
+void Mgr::StoreToCommWriter::scheduleCommWrite(const StoreIOBuffer&) STUB
+void Mgr::StoreToCommWriter::noteCommWrote(const CommIoCbParams&) STUB
+void Mgr::StoreToCommWriter::noteCommClosed(const CommCloseCbParams&) STUB
void Mgr::StoreToCommWriter::close() STUB
#include "mgr/StringParam.h"
//Mgr::StringParam::StringParam() STUB
-//Mgr::StringParam::StringParam(const String& aString) STUB
-void Mgr::StringParam::pack(Ipc::TypedMsgHdr& msg) const STUB
-void Mgr::StringParam::unpackValue(const Ipc::TypedMsgHdr& msg) STUB
+//Mgr::StringParam::StringParam(const String&) STUB
+void Mgr::StringParam::pack(Ipc::TypedMsgHdr&) const STUB
+void Mgr::StringParam::unpackValue(const Ipc::TypedMsgHdr&) STUB
static String t;
const String& Mgr::StringParam::value() const STUB_RETVAL(t)
void Security::NegotiationHistory::retrieveNegotiatedInfo(const Security::SessionPointer &) STUB
void Security::NegotiationHistory::retrieveParsedInfo(Security::TlsDetails::Pointer const &) STUB
const char *Security::NegotiationHistory::cipherName() const STUB
-const char *Security::NegotiationHistory::printTlsVersion(AnyP::ProtocolVersion const &v) const STUB
+const char *Security::NegotiationHistory::printTlsVersion(AnyP::ProtocolVersion const &) const STUB
#include "security/PeerConnector.h"
class TlsNegotiationDetails: public RefCountable {};
Ssl::Config Ssl::TheConfig;
#include "ssl/context_storage.h"
-//Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &cmd) STUB
-Ssl::CertificateStorageAction::Pointer Ssl::CertificateStorageAction::Create(const Mgr::Command::Pointer &cmd) STUB_RETSTATREF(Ssl::CertificateStorageAction::Pointer)
-void Ssl::CertificateStorageAction::dump(StoreEntry *sentry) STUB
-void Ssl::GlobalContextStorage::addLocalStorage(Ip::Address const & address, size_t size_of_store) STUB
-Ssl::LocalContextStorage *Ssl::GlobalContextStorage::getLocalStorage(Ip::Address const & address)
+//Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &) STUB
+Ssl::CertificateStorageAction::Pointer Ssl::CertificateStorageAction::Create(const Mgr::Command::Pointer &) STUB_RETSTATREF(Ssl::CertificateStorageAction::Pointer)
+void Ssl::CertificateStorageAction::dump(StoreEntry *) STUB
+void Ssl::GlobalContextStorage::addLocalStorage(Ip::Address const &, size_t ) STUB
+Ssl::LocalContextStorage *Ssl::GlobalContextStorage::getLocalStorage(Ip::Address const &)
{ fatal(STUB_API " required"); static LocalContextStorage v(0); return &v; }
void Ssl::GlobalContextStorage::reconfigureStart() STUB
//Ssl::GlobalContextStorage Ssl::TheGlobalContextStorage;
#include "ssl/ErrorDetail.h"
-Security::ErrorCode parseErrorString(const char *name) STUB_RETVAL(0)
-
#include "ssl/support.h"
namespace Ssl
{
+bool ParseErrorString(const char *, Security::Errors &) STUB_RETVAL(false)
int AskPasswordCb(char *, int, int, void *) STUB_RETVAL(0)
bool InitServerContext(Security::ContextPointer &, AnyP::PortCfg &) STUB_RETVAL(false)
bool InitClientContext(Security::ContextPointer &, Security::PeerOptions &, Security::ParsedPortFlags) STUB_RETVAL(false)
void DisablePeerVerification(Security::ContextPointer &) STUB
void MaybeSetupRsaCallback(Security::ContextPointer &) STUB
} // namespace Ssl
-const char *sslGetUserEmail(SSL *ssl) STUB_RETVAL(NULL)
-const char *sslGetUserAttribute(SSL *ssl, const char *attribute_name) STUB_RETVAL(NULL)
-const char *sslGetCAAttribute(SSL *ssl, const char *attribute_name) STUB_RETVAL(NULL)
-SBuf sslGetUserCertificatePEM(SSL *ssl) STUB_RETVAL(SBuf())
-SBuf sslGetUserCertificateChainPEM(SSL *ssl) STUB_RETVAL(SBuf())
+const char *sslGetUserEmail(SSL *) STUB_RETVAL(nullptr)
+const char *sslGetUserAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
+const char *sslGetCAAttribute(SSL *, const char *) STUB_RETVAL(nullptr)
+SBuf sslGetUserCertificatePEM(SSL *) STUB_RETVAL(SBuf())
+SBuf sslGetUserCertificateChainPEM(SSL *) STUB_RETVAL(SBuf())
namespace Ssl
{
//GETX509ATTRIBUTE GetX509UserAttribute;
std::vector<const char *> BumpModeStr = {""};
bool generateUntrustedCert(Security::CertPointer &, Security::PrivateKeyPointer &, Security::CertPointer const &, Security::PrivateKeyPointer const &) STUB_RETVAL(false)
Security::ContextPointer GenerateSslContext(CertificateProperties const &, Security::ServerOptions &, bool) STUB_RETVAL(Security::ContextPointer())
-bool verifySslCertificate(Security::ContextPointer &, CertificateProperties const &) STUB_RETVAL(false)
+bool verifySslCertificate(const Security::ContextPointer &, CertificateProperties const &) STUB_RETVAL(false)
Security::ContextPointer GenerateSslContextUsingPkeyAndCertFromMemory(const char *, Security::ServerOptions &, bool) STUB_RETVAL(Security::ContextPointer())
-int matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_func)(void *check_data, ASN1_STRING *cn_data)) STUB_RETVAL(0)
-bool checkX509ServerValidity(X509 *cert, const char *server) STUB_RETVAL(false)
-int asn1timeToString(ASN1_TIME *tm, char *buf, int len) STUB_RETVAL(0)
-void setClientSNI(SSL *ssl, const char *fqdn) STUB
-SBuf GetX509PEM(SSL *ssl) STUB_RETVAL(SBuf())
+int matchX509CommonNames(X509 *, void *, int (*)(void *, ASN1_STRING *)) STUB_RETVAL(0)
+bool checkX509ServerValidity(X509 *, const char *) STUB_RETVAL(false)
+int asn1timeToString(ASN1_TIME *, char *, int) STUB_RETVAL(0)
+void setClientSNI(SSL *, const char *) STUB
+SBuf GetX509PEM(X509 *) STUB_RETVAL(SBuf())
} //namespace Ssl
#endif
bool Disks::SmpAware() STUB_RETVAL(false)
bool Disks::hasReadableEntry(const StoreEntry &) const STUB_RETVAL(false)
void Disks::Parse(DiskConfig &) STUB
-void Disks::Dump(const DiskConfig &, StoreEntry &, const char *name) STUB
+void Disks::Dump(const DiskConfig &, StoreEntry &, const char *) STUB
SwapDir *Disks::SelectSwapDir(const StoreEntry *) STUB_RETVAL(nullptr)
}
void storeDirOpenSwapLogs(void) STUB
*/
#include "squid.h"
+#include "protos.h"
#define STUB_API "stub_main_cc.cc"
#include "tests/STUB.h"
#define STUB_API "mem_node.cc"
#include "tests/STUB.h"
-mem_node::mem_node(int64_t offset):nodeBuffer(0,offset,data) STUB
+mem_node::mem_node(int64_t offset) : nodeBuffer(0,offset,data) STUB
size_t mem_node::InUseCount() STUB_RETVAL(0)
*/
#include "squid.h"
+#include "mime_header.h"
+#include "sbuf/SBuf.h"
#define STUB_API "mime.cc"
#include "tests/STUB.h"
size_t headersEnd(const char *, size_t, bool &) STUB_RETVAL(0)
+size_t headersEnd(const SBuf &, bool &) STUB_RETVAL(0)
#include "neighbors.h"
void
-peerConnClosed(CachePeer *p) STUB
+peerConnClosed(CachePeer *) STUB
time_t
FwdState::ForwardTimeout(const time_t) STUB_RETVAL(0)
bool
-FwdState::EnoughTimeToReForward(const time_t fwdStart) STUB_RETVAL(false)
+FwdState::EnoughTimeToReForward(const time_t) STUB_RETVAL(false)
#define STUB_API "pconn.cc"
#include "tests/STUB.h"
-IdleConnList::IdleConnList(const char *akey, PconnPool *parent) STUB
+IdleConnList::IdleConnList(const char *, PconnPool *) STUB
IdleConnList::~IdleConnList() STUB
-void IdleConnList::push(const Comm::ConnectionPointer &conn) STUB
-Comm::ConnectionPointer IdleConnList::findUseable(const Comm::ConnectionPointer &akey) STUB_RETVAL(Comm::ConnectionPointer())
-void IdleConnList::clearHandlers(const Comm::ConnectionPointer &conn) STUB
+void IdleConnList::push(const Comm::ConnectionPointer &) STUB
+Comm::ConnectionPointer IdleConnList::findUseable(const Comm::ConnectionPointer &) STUB_RETVAL(Comm::ConnectionPointer())
+void IdleConnList::clearHandlers(const Comm::ConnectionPointer &) STUB
void IdleConnList::endingShutdown() STUB
PconnPool::PconnPool(const char *, const CbcPointer<PeerPoolMgr>&) STUB
PconnPool::~PconnPool() STUB
void PconnPool::moduleInit() STUB
-void PconnPool::push(const Comm::ConnectionPointer &serverConn, const char *domain) STUB
-Comm::ConnectionPointer PconnPool::pop(const Comm::ConnectionPointer &destLink, const char *domain, bool retriable) STUB_RETVAL(Comm::ConnectionPointer())
-void PconnPool::count(int uses) STUB
+void PconnPool::push(const Comm::ConnectionPointer &, const char *) STUB
+Comm::ConnectionPointer PconnPool::pop(const Comm::ConnectionPointer &, const char *, bool) STUB_RETVAL(Comm::ConnectionPointer())
+void PconnPool::count(int) STUB
void PconnPool::noteUses(int) STUB
-void PconnPool::dumpHist(StoreEntry *e) const STUB
-void PconnPool::dumpHash(StoreEntry *e) const STUB
-void PconnPool::unlinkList(IdleConnList *list) STUB
+void PconnPool::dumpHist(StoreEntry *) const STUB
+void PconnPool::dumpHash(StoreEntry *) const STUB
+void PconnPool::unlinkList(IdleConnList *) STUB
PconnModule * PconnModule::GetInstance() STUB_RETVAL(NULL)
-void PconnModule::DumpWrapper(StoreEntry *e) STUB
+void PconnModule::DumpWrapper(StoreEntry *) STUB
PconnModule::PconnModule() STUB
void PconnModule::registerWithCacheManager(void) STUB
void PconnModule::add(PconnPool *) STUB
/* DEBUG: section 18 Cache Manager Statistics */
#include "squid.h"
+#include "Store.h"
#define STUB_API "stat.cc"
#include "tests/STUB.h"
mem_hdr::~mem_hdr() STUB
size_t mem_hdr::size() const STUB_RETVAL(0)
int64_t mem_hdr::endOffset () const STUB_RETVAL(0)
-bool mem_hdr::write (StoreIOBuffer const &writeBuffer) STUB_RETVAL(false)
+bool mem_hdr::write (StoreIOBuffer const &) STUB_RETVAL(false)
const char *swapStatusStr[] = { };
#include "RemovalPolicy.h"
-RemovalPolicy * createRemovalPolicy(RemovalPolicySettings * settings) STUB_RETVAL(NULL)
+RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *) STUB_RETVAL(nullptr)
#include "Store.h"
StoreIoStats store_io_stats;
-bool StoreEntry::checkDeferRead(int fd) const STUB_RETVAL(false)
-const char *StoreEntry::getMD5Text() const STUB_RETVAL(NULL)
+bool StoreEntry::checkDeferRead(int) const STUB_RETVAL(false)
+const char *StoreEntry::getMD5Text() const STUB_RETVAL(nullptr)
StoreEntry::StoreEntry() STUB
StoreEntry::~StoreEntry() STUB
void StoreEntry::write(StoreIOBuffer) STUB
size_t StoreEntry::bytesWanted(Range<size_t> const, bool) const STUB_RETVAL(0)
void StoreEntry::complete() STUB
store_client_t StoreEntry::storeClientType() const STUB_RETVAL(STORE_NON_CLIENT)
-char const *StoreEntry::getSerialisedMetaData(size_t &length) const STUB_RETVAL(NULL)
-void StoreEntry::replaceHttpReply(const HttpReplyPointer &, bool andStartWriting) STUB
+char const *StoreEntry::getSerialisedMetaData(size_t &) const STUB_RETVAL(nullptr)
+void StoreEntry::replaceHttpReply(const HttpReplyPointer &, bool) STUB
bool StoreEntry::mayStartSwapOut() STUB_RETVAL(false)
-void StoreEntry::trimMemory(const bool preserveSwappable) STUB
+void StoreEntry::trimMemory(const bool) STUB
void StoreEntry::abort() STUB
-bool StoreEntry::makePublic(const KeyScope scope) STUB
-void StoreEntry::makePrivate(const bool shareable) STUB
-bool StoreEntry::setPublicKey(const KeyScope scope) STUB
+bool StoreEntry::makePublic(const KeyScope) STUB
+void StoreEntry::makePrivate(const bool) STUB
+bool StoreEntry::setPublicKey(const KeyScope) STUB
void StoreEntry::setPrivateKey(const bool, const bool) STUB
void StoreEntry::expireNow() STUB
-void StoreEntry::releaseRequest(const bool shareable) STUB
+void StoreEntry::releaseRequest(const bool) STUB
void StoreEntry::negativeCache() STUB
bool StoreEntry::cacheNegatively() STUB
void StoreEntry::swapOut() STUB
-void StoreEntry::swapOutFileClose(int how) STUB
-const char *StoreEntry::url() const STUB_RETVAL(NULL)
+void StoreEntry::swapOutFileClose(int) STUB
+const char *StoreEntry::url() const STUB_RETVAL(nullptr)
bool StoreEntry::checkCachable() STUB_RETVAL(false)
int StoreEntry::checkNegativeHit() const STUB_RETVAL(0)
int StoreEntry::validToSend() const STUB_RETVAL(0)
bool StoreEntry::memoryCachable() STUB_RETVAL(false)
void StoreEntry::createMemObject() STUB
-void StoreEntry::createMemObject(const char *, const char *, const HttpRequestMethod &aMethod) STUB
+void StoreEntry::createMemObject(const char *, const char *, const HttpRequestMethod &) STUB
void StoreEntry::ensureMemObject(const char *, const char *, const HttpRequestMethod &) STUB
-void StoreEntry::dump(int debug_lvl) const STUB
+void StoreEntry::dump(int) const STUB
void StoreEntry::hashDelete() STUB
void StoreEntry::hashInsert(const cache_key *) STUB
void StoreEntry::registerAbortCallback(const AsyncCall::Pointer &) STUB
void StoreEntry::unregisterAbortCallback(const char *) STUB
void StoreEntry::destroyMemObject() STUB
int StoreEntry::checkTooSmall() STUB_RETVAL(0)
-void StoreEntry::delayAwareRead(const Comm::ConnectionPointer&, char *buf, int len, AsyncCall::Pointer callback) STUB
+void StoreEntry::delayAwareRead(const Comm::ConnectionPointer&, char *, int, AsyncCall::Pointer) STUB
void StoreEntry::setNoDelay (bool const) STUB
bool StoreEntry::modifiedSince(const time_t, const int) const STUB_RETVAL(false)
-bool StoreEntry::hasIfMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
-bool StoreEntry::hasIfNoneMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
+bool StoreEntry::hasIfMatchEtag(const HttpRequest &) const STUB_RETVAL(false)
+bool StoreEntry::hasIfNoneMatchEtag(const HttpRequest &) const STUB_RETVAL(false)
Store::Disk &StoreEntry::disk() const STUB_RETREF(Store::Disk)
size_t StoreEntry::inUseCount() STUB_RETVAL(0)
-void *StoreEntry::operator new(size_t byteCount)
+void *StoreEntry::operator new(size_t)
{
STUB
return new StoreEntry();
}
-void StoreEntry::operator delete(void *address) STUB
+void StoreEntry::operator delete(void *) STUB
//#if USE_SQUID_ESI
-//ESIElement::Pointer StoreEntry::cachedESITree STUB_RETVAL(NULL)
+//ESIElement::Pointer StoreEntry::cachedESITree STUB_RETVAL(nullptr)
//#endif
void StoreEntry::buffer() STUB
void StoreEntry::flush() STUB
int StoreEntry::unlock(const char *) STUB_RETVAL(0)
void StoreEntry::lock(const char *) STUB
void StoreEntry::touch() STUB
-void StoreEntry::release(const bool shareable) STUB
+void StoreEntry::release(const bool) STUB
void StoreEntry::append(char const *, int) STUB
void StoreEntry::vappendf(const char *, va_list) STUB
-void StoreEntry::setCollapsingRequirement(const bool required) STUB
+void StoreEntry::setCollapsingRequirement(const bool) STUB
-void Store::Maintain(void *unused) STUB
+void Store::Maintain(void *) STUB
std::ostream &operator <<(std::ostream &os, const StoreEntry &)
{
size_t storeEntryInUse() STUB_RETVAL(0)
void storeEntryReplaceObject(StoreEntry *, HttpReply *) STUB
-StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
-StoreEntry *storeGetPublicByRequest(HttpRequest * request, const KeyScope scope) STUB_RETVAL(NULL)
-StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method, const KeyScope scope) STUB_RETVAL(NULL)
-StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
-StoreEntry *storeCreatePureEntry(const char *storeId, const char *logUrl, const HttpRequestMethod&) STUB_RETVAL(nullptr)
+StoreEntry *storeGetPublic(const char *, const HttpRequestMethod&) STUB_RETVAL(nullptr)
+StoreEntry *storeGetPublicByRequest(HttpRequest *, const KeyScope) STUB_RETVAL(nullptr)
+StoreEntry *storeGetPublicByRequestMethod(HttpRequest *, const HttpRequestMethod&, const KeyScope) STUB_RETVAL(nullptr)
+StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(nullptr)
+StoreEntry *storeCreatePureEntry(const char *, const char *, const HttpRequestMethod&) STUB_RETVAL(nullptr)
void storeConfigure(void) STUB
int expiresMoreThan(time_t, time_t) STUB_RETVAL(0)
void storeAppendPrintf(StoreEntry *, const char *,...) STUB
-void storeAppendVPrintf(StoreEntry *, const char *, va_list ap) STUB
+void storeAppendVPrintf(StoreEntry *, const char *, va_list) STUB
int storeTooManyDiskFilesOpen(void) STUB_RETVAL(0)
void storeHeapPositionUpdate(StoreEntry *, SwapDir *) STUB
-void storeSwapFileNumberSet(StoreEntry * e, sfileno filn) STUB
+void storeSwapFileNumberSet(StoreEntry *, sfileno) STUB
void storeFsInit(void) STUB
void storeFsDone(void) STUB
void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB
void destroyStoreEntry(void *) STUB
-void storeGetMemSpace(int size) STUB
+void storeGetMemSpace(int) STUB
*/
#include "squid.h"
+#include "repl_modules.h"
+#include "store_digest.h"
+#include "store_log.h"
+#include "store_rebuild.h"
#include "Store.h"
#include "StoreClient.h"
#define STUB_API "store_client.cc"
#include "tests/STUB.h"
-int storePendingNClients(const StoreEntry * e)
-{
- /* no clients in the tests so far */
- return 0;
-}
-
-void StoreEntry::invokeHandlers()
-{
- /* do nothing for tests */
-}
-
-void
-storeLog(int tag, const StoreEntry * e)
-{
- /* do nothing for tests - we don't need the log */
-}
-
+int storePendingNClients(const StoreEntry *) STUB_RETVAL_NOP(0)
+void StoreEntry::invokeHandlers() STUB_NOP
+void storeLog(int, const StoreEntry *) STUB_NOP
void storeLogOpen(void) STUB
void storeDigestInit(void) STUB
void storeRebuildStart(void) STUB
void storeReplSetup(void) STUB
-bool store_client::memReaderHasLowerOffset(int64_t anOffset) const STUB_RETVAL(false)
-void store_client::dumpStats(MemBuf * output, int clientNumber) const STUB
+bool store_client::memReaderHasLowerOffset(int64_t) const STUB_RETVAL(false)
+void store_client::dumpStats(MemBuf *, int) const STUB
int store_client::getType() const STUB_RETVAL(0)
*/
#include "squid.h"
+#include "store_digest.h"
#define STUB_API "store_digets.cc"
#include "tests/STUB.h"
#define STUB_API "stub_store_rebuild.cc"
#include "tests/STUB.h"
-void storeRebuildProgress(int sd_index, int total, int sofar) STUB
+void storeRebuildProgress(int, int, int) STUB
bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, StoreRebuildData &, uint64_t) STUB_RETVAL(false)
void StoreRebuildData::updateStartTime(const timeval &dirStartTime)
}
bool
-storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &)
+storeRebuildLoadEntry(int fd, int, MemBuf &buf, StoreRebuildData &)
{
if (fd < 0)
return false;
#include <cstring>
StoreInfoStats &
-StoreInfoStats::operator +=(const StoreInfoStats &stats) STUB_RETVAL(*this)
+StoreInfoStats::operator +=(const StoreInfoStats &) STUB_RETVAL(*this)
StoreIoStats::StoreIoStats()
{
#include <iostream>
-/* XXX: wrong stub file... */
-void storeUnlink(StoreEntry * e) STUB
-
-char *storeSwapMetaPack(tlv * tlv_list, int *length) STUB_RETVAL(NULL)
+char *storeSwapMetaPack(tlv *, int *) STUB_RETVAL(nullptr)
tlv *storeSwapMetaBuild(const StoreEntry *) STUB_RETVAL(nullptr)
-void storeSwapTLVFree(tlv * n) STUB
+void storeSwapTLVFree(tlv *) STUB
int DebugSignal = -1;
SBuf service_name(APP_SHORTNAME);
void releaseServerSockets(void) STUB_NOP
-char * dead_msg(void) STUB_RETVAL(NULL)
-void mail_warranty(void) STUB
void dumpMallocStats(void) STUB
void squid_getrusage(struct rusage *) STUB
double rusage_cputime(struct rusage *) STUB_RETVAL(0)
void setUmask(mode_t) STUB
void strwordquote(MemBuf *, const char *) STUB
void keepCapabilities(void) STUB
-void restoreCapabilities(bool) STUB
pid_t WaitForOnePid(pid_t, PidStatus &, int) STUB_RETVAL(0)
#if _SQUID_WINDOWS_
*/
#include "squid.h"
+#include "client_side_request.h"
+#include "FwdState.h"
+#include "http/Stream.h"
+#include "tunnel.h"
#define STUB_API "tunnel.cc"
#include "tests/STUB.h"
-
-#include "FwdState.h"
class ClientHttpRequest;
void tunnelStart(ClientHttpRequest *) STUB
*/
#include "squid.h"
+#include "wccp2.h"
#if USE_WCCPv2
class StoreEntry;
-void wccp2_add_service_list(int, int, int, int, int, int[], int, char *) STUB
void wccp2Init(void) STUB
void wccp2ConnectionOpen(void) STUB
void wccp2ConnectionClose(void) STUB
*/
#include "squid.h"
+#include "FwdState.h"
+#include "whois.h"
#define STUB_API "whois.cc"
#include "tests/STUB.h"
-class FwdState;
-
void whoisStart(FwdState *) STUB
#include "squid.h"
#include "ConfigParser.h"
-#include "event.h"
#include "SquidString.h"
#include "testConfigParser.h"
#include "unitTestMain.h"
CPPUNIT_TEST_SUITE_REGISTRATION( testConfigParser);
-/* let this test link sanely */
-void
-eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
-{}
-
void testConfigParser::setUp()
{
}
{
#ifdef SQUID_DEBUG_TESTS
std::cerr << "TEST @" << line << ", in=" << Pretty(input) << "\n";
+#else
+ (void)line;
#endif
const bool parsed = output.parse(input);
virtual void Close() {};
/// Construct ECHO request
- virtual void SendEcho(Ip::Address &to, int opcode, const char *payload, int len) {};
+ virtual void SendEcho(Ip::Address &, int, const char *, int) {}
/// Handle ICMP responses.
virtual void Recv(void) {};
ToRefCount anObject(new _ToRefCount);
CPPUNIT_ASSERT_EQUAL(1, _ToRefCount::Instances);
CPPUNIT_ASSERT_EQUAL(1, anObject->someMethod());
- anObject = anObject;
+ anObject = *&anObject; // test self-assign without -Wself-assign-overloaded warnings
CPPUNIT_ASSERT_EQUAL(1, _ToRefCount::Instances);
ToRefCount objectTwo (anObject);
anObject = objectTwo;
#include "event.h"
#include "MemObject.h"
void
-eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
+eventAdd(const char *, EVH *, void *, double, int, bool)
{}
int64_t
MemObject::endOffset() const
static StoreEntry *
addedEntry(Store::Disk *aStore,
String name,
- String varySpec,
- String varyKey
-
+ String,
+ String
)
{
StoreEntry *e = new StoreEntry();
static bool cbcalled;
static void
-searchCallback(void *cbdata)
+searchCallback(void *)
{
cbcalled = true;
}
Store::FreeMemory();
}
-StoreEntry *
+static StoreEntry *
addedEntry(Store::Disk *aStore,
String name,
- String varySpec,
- String varyKey
-
+ String,
+ String
)
{
StoreEntry *e = new StoreEntry();
return e;
}
-void commonInit()
+static void commonInit()
{
static bool inited = false;
static bool cbcalled;
static void
-searchCallback(void *cbdata)
+searchCallback(void *)
{
cbcalled = true;
}
*/
#include "squid.h"
-#include "event.h"
+#include "mem/forward.h"
#include "SquidString.h"
#include "testString.h"
#include "unitTestMain.h"
CPPUNIT_TEST_SUITE_REGISTRATION( testString );
-/* let this test link sanely */
-void
-eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
-{}
-
/* init memory pools */
void
static bool cbcalled;
static void
-searchCallback(void *cbdata)
+searchCallback(void *)
{
cbcalled = true;
}
#include "fatal.h"
#include "HttpHeader.h"
#include "HttpHeaderRange.h"
+#include "HttpHeaderTools.h"
// TODO: refactor as cppunit test
-void httpHeaderPutStr(HttpHeader * hdr, Http::HdrType type, const char *str)
-{
- fatal ("dummy function\n");
-}
-
-HttpHeaderEntry *httpHeaderGetEntry(const HttpHeader * hdr, HttpHeaderPos * pos)
-{
- fatal ("dummy function\n");
- return NULL;
-}
-
-String httpHeaderGetList(const HttpHeader * hdr, Http::HdrType id)
-{
- fatal ("dummy function\n");
- return String();
-}
-
-int httpHeaderHas(const HttpHeader * hdr, Http::HdrType type)
-{
- fatal ("dummy function\n");
- return 0;
-}
-
-void httpHeaderPutContRange(HttpHeader * hdr, const HttpHdrContRange * cr)
-{
- fatal ("dummy function\n");
-}
-
-void
+static void
testRangeParser(char const *rangestring)
{
String aString (rangestring);
delete range;
}
-HttpHdrRange *
+static HttpHdrRange *
rangeFromString(char const *rangestring)
{
String aString (rangestring);
return range;
}
-void
+static void
testRangeIter ()
{
HttpHdrRange *range=rangeFromString("bytes=0-3, 1-, -2");
assert (i - range->end() == -2);
}
-void
+static void
testRangeCanonization()
{
HttpHdrRange *range=rangeFromString("bytes=0-3, 1-, -2");
}
int
-main(int argc, char **argv)
+main(int, char **)
{
try {
Mem::Init();
cap_free(caps);
}
#elif _SQUID_LINUX_
+ (void)keep;
Ip::Interceptor.StopTransparency("Missing needed capability support.");
+#else
+ (void)keep;
#endif /* HAVE_SYS_CAPABILITY_H */
}
#include "ssl/ServerBump.h"
#endif
#include "tools.h"
+#include "tunnel.h"
#if USE_DELAY_POOLS
#include "DelayId.h"
#endif
method_(method), tunnel_(tunnel), answer_() {}
/* CallDialer API */
- virtual bool canDial(AsyncCall &call) { return tunnel_.valid(); }
- void dial(AsyncCall &call) { ((&(*tunnel_))->*method_)(answer_); }
+ virtual bool canDial(AsyncCall &) { return tunnel_.valid(); }
+ void dial(AsyncCall &) { ((&(*tunnel_))->*method_)(answer_); }
virtual void print(std::ostream &os) const {
os << '(' << tunnel_.get() << ", " << answer_ << ')';
}
#if USE_DELAY_POOLS
return delayId.bytesWanted(lowerbound, upperbound);
#else
-
+ (void)lowerbound;
return upperbound;
#endif
}
--- /dev/null
+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
+#ifndef TUNNEL_H_
+#define TUNNEL_H_
+
+#include "comm/forward.h"
+#include "sbuf/forward.h"
+
+class HttpRequest;
+void switchToTunnel(HttpRequest *request, const Comm::ConnectionPointer &clientConn, const Comm::ConnectionPointer &srvConn, const SBuf &preReadServerData);
+
+#endif /* TUNNEL_H_ */
+
#include "StatCounters.h"
#include "store/Disk.h"
#include "tools.h"
+#include "unlinkd.h"
#include "xusleep.h"
/* This code gets linked to Squid */
#include "event.h"
#include "fatal.h"
#include "SquidConfig.h"
+#include "wccp.h"
#define WCCP_PORT 2048
#define WCCP_REVISION 0
#include "Parsing.h"
#include "SquidConfig.h"
#include "Store.h"
+#include "wccp2.h"
#if HAVE_NETDB_H
#include <netdb.h>
/* END WCCP V2 PROTOCOL TYPES DEFINITION */
-void wccp2_add_service_list(int service, int service_id, int service_priority,
- int service_proto, int service_flags, int ports[], int security_type, char *password);
+static void wccp2_add_service_list(int service, int service_id, int service_priority,
+ int service_proto, int service_flags, int ports[], int security_type, char *password);
static void wccp2SortCacheList(struct wccp2_cache_list_t *head);
/*
#include "StatCounters.h"
#include "Store.h"
#include "tools.h"
+#include "whois.h"
#include <cerrno>
char const *getACString() const;
};
-std::ostream &operator << (std::ostream &aStream, StreamTest &anObject)
+static std::ostream &
+operator << (std::ostream &aStream, StreamTest &anObject)
{
return anObject.serialise(aStream);
}
#include <iostream>
#include <sstream>
-void
+static void
testLowAndHigh()
{
mem_hdr aHeader;
assert (!aHeader.hasContigousContentRange(Range<int64_t>(10,101)));
}
-void
+static void
testSplayOfNodes()
{
Splay<mem_node *> aSplay;
aSplay.destroy();
}
-void
+static void
testHdrVisit()
{
mem_hdr aHeader;
int i;
};
-int
-compareintvoid(void * const &a, void * const &n)
+static int
+compareintvoid(void *const &a, void *const &n)
{
intnode *A = (intnode *)a;
intnode *B = (intnode *)n;
return A->i - B->i;
}
-int
-compareint(intnode * const &a, intnode * const &b)
+static int
+compareint(intnode *const &a, intnode *const &b)
{
return a->i - b->i;
}
CheckNode (a);
}
-void
-destintvoid(void * &data)
+static void
+destintvoid(void *&data)
{
intnode *i = (intnode *)data;
xfree (i);
}
-void
-destint(intnode * &data)
+static void
+destint(intnode *&data)
{
delete data;
}
-int
+static int
compareintref(intnode const &a, intnode const &b)
{
return a.i - b.i;
}
-void
-destintref (intnode &)
+static void
+destintref(intnode &)
{}
int
Assignments_ = newValue;
}
-void
+static void
CheckHasExplicitWorks()
{
assert (HasExplicit::Instances() == 0);
HasExplicit aMember;
};
-void
+static void
CheckSyntheticWorks()
{
assert (HasExplicit::Instances() == 0);
return "";
}
-bool
+static bool
hostname_check(const char *uri)
{
static CharacterSet hostChars = CharacterSet("host",".:[]_") +
}
istate = isActions;
- /* yes, fall through, we do not want to loose the first line */
+ /* [[fallthrough]] we do not want to lose the first line */
case isActions:
if (strncmp(buf, "action:", 7) == 0) {
}
istate = isBody;
- /* yes, fall through, we do not want to loose the first line */
+ /* [[fallthrough]] we do not want to lose the first line */
case isBody:
{
// ----------------------------------------------------------------------
-char*
-concat( const char* start, ... )
+static char *
+concat(const char *start, ...)
// purpose: concatinate an arbitrary number of C strings.
// paramtr: start (IN): first C string
// ... (IN): further C strings, terminated with a NULL pointer
return result;
}
-bool
+static bool
isxstring( const char* s, size_t testlen )
// purpose: test a string for conforming to xdigit
// paramtr: s (IN): string to test
static struct in_addr serverHost;
static unsigned short serverPort;
-bool
-action( int fd, size_t metasize,
- const char* fn, const char* url, const SquidMetaList& meta )
+static bool
+action(int fd, size_t metasize,
+ const char *fn, const char *url, const SquidMetaList &meta)
// purpose: if cmdline-requested, send the purge request to the cache
// paramtr: fd (IN): open FD for the object file
// metasize (IN): offset into data portion of file (meta data size)
return flag;
}
-bool
-match( const char* fn, const REList* list )
+static bool
+match(const char *fn, const REList *list)
// purpose: do something with the given cache content filename
// paramtr: fn (IN): filename of cache file
// returns: true for successful action, false otherwise.
return flag;
}
-bool
-filelevel( const char* directory, const REList* list )
+static bool
+filelevel(const char *directory, const REList *list)
// purpose: from given starting point, look for squid xxxxxxxx files.
// example: "/var/spool/cache/08/7F" as input, do action over files
// paramtr: directory (IN): starting point
return flag;
}
-bool
-dirlevel( const char* dirname, const REList* list, bool level=false )
+static bool
+dirlevel(const char *dirname, const REList *list, bool level = false)
// purpose: from given starting point, look for squid 00..FF directories.
// paramtr: dirname (IN): starting point
// list (IN): list of rexps to match URLs against
return flag;
}
-int
-checkForPortOnly( const char* arg )
+static int
+checkForPortOnly(const char *arg)
// purpose: see if somebody just put in a port instead of a hostname
// paramtr: optarg (IN): argument from commandline
// returns: 0..65535 is the valid port number in network byte order,
return -1;
}
-void
-helpMe( void )
+static void
+helpMe(void)
// purpuse: write help message and exit
{
printf( "\nUsage:\t%s\t[-a] [-c cf] [-d l] [-(f|F) fn | -(e|E) re] "
}
-void
-parseCommandline( int argc, char* argv[], REList*& head,
- char*& conffile, char*& copyDirPath,
- struct in_addr& serverHostIp, unsigned short& serverHostPort )
+static void
+parseCommandline(int argc, char *argv[], REList *&head,
+ char *&conffile, char *©DirPath,
+ struct in_addr &serverHostIp, unsigned short &serverHostPort)
// paramtr: argc: see ::main().
// argv: see ::main().
// returns: Does terminate the program on errors!
return 0;
}
-int
-commonCode( int& sockfd, bool nodelay, int sendBufferSize, int recvBufferSize )
+static int
+commonCode(int &sockfd, bool nodelay, int sendBufferSize, int recvBufferSize)
// purpose: common code in server sockets and client sockets
// paramtr: sockfd (IO): socket filedescriptor
// nodelay (IN): true=set TCP_NODELAY option.
return false;
}
}
+#else
+ (void)hostname;
#endif
return true;
}
case 'p': /* port number */
// rewind and let the Transport::Config parser handle
optind -= 2;
+ Transport::Config.parseCommandOpts(argc, argv, c, optIndex);
+ continue;
case '\3': // request over a TLS connection
Transport::Config.parseCommandOpts(argc, argv, c, optIndex);