No functionality changes are expected.
check_PROGRAMS += tests/testHttpRequest
tests_testHttpRequest_SOURCES = \
- $(DELAY_POOL_SOURCE) \
- $(DNSSOURCE) \
- $(HTCPSOURCE) \
- $(IPC_SOURCE) \
- $(SNMP_SOURCE) \
- $(WIN32_SOURCE) \
- AccessLogEntry.cc \
- AuthReg.h \
- BodyPipe.cc \
- tests/stub_CacheDigest.cc \
- CacheDigest.h \
- CachePeer.cc \
- CachePeer.h \
- CachePeers.cc \
- CachePeers.h \
- ClientInfo.h \
- tests/stub_CollapsedForwarding.cc \
- ConfigOption.cc \
+ tests/testHttpRequest.cc \
+ tests/testHttpRequestMethod.cc
+nodist_tests_testHttpRequest_SOURCES = \
+ $(TESTSOURCES) \
+ tests/stub_ACLFilledChecklist.cc \
+ tests/stub_CachePeer.cc \
ConfigParser.cc \
- CpuAffinityMap.cc \
- CpuAffinityMap.h \
- CpuAffinitySet.cc \
- CpuAffinitySet.h \
tests/stub_ETag.cc \
- tests/stub_EventLoop.cc \
- ExternalACLEntry.cc \
- FadingCounter.cc \
- FwdState.cc \
- FwdState.h \
- HappyConnOpener.cc \
- HappyConnOpener.h \
- HeaderMangling.cc \
- HeaderMangling.h \
- HttpBody.cc \
- HttpBody.h \
- tests/stub_HttpControlMsg.cc \
+ tests/stub_HelperChildConfig.cc \
HttpHdrCc.cc \
- HttpHdrCc.h \
HttpHdrContRange.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
HttpHeader.cc \
- HttpHeader.h \
- HttpHeaderFieldStat.h \
HttpHeaderTools.cc \
- HttpHeaderTools.h \
- HttpReply.cc \
+ tests/stub_HttpReply.cc \
HttpRequest.cc \
- tests/testHttpRequest.cc \
- tests/testHttpRequestMethod.cc \
- tests/stub_HttpUpgradeProtocolAccess.cc \
- tests/stub_Instance.cc \
- IoStats.h \
- tests/stub_IpcIoFile.cc \
- LogTags.cc \
MasterXaction.cc \
- MasterXaction.h \
MemBuf.cc \
- MemObject.cc \
- MemStore.cc \
Notes.cc \
- Notes.h \
- Parsing.cc \
- PeerPoolMgr.cc \
- PeerPoolMgr.h \
- Pipeline.cc \
- Pipeline.h \
- RefreshPattern.h \
- RemovalPolicy.cc \
RequestFlags.cc \
- RequestFlags.h \
- ResolvedPeers.cc \
- ResolvedPeers.h \
- SquidMath.cc \
- SquidMath.h \
- StatCounters.cc \
- StatCounters.h \
StatHist.cc \
- StatHist.h \
- StoreFileSystem.cc \
- StoreIOState.cc \
- StoreSwapLogData.cc \
StrList.cc \
- StrList.h \
String.cc \
- Transients.cc \
+ tests/stub_access_log.cc \
+ tests/stub_acl.cc \
+ tests/stub_adaptation_History.cc \
tests/stub_cache_cf.cc \
- cache_cf.h \
- cache_manager.cc \
- tests/stub_carp.cc \
- carp.h \
- cbdata.cc \
- clientStream.cc \
- tests/stub_client_db.cc \
- client_side.cc \
- client_side.h \
- client_side_reply.cc \
- client_side_request.cc \
- dlink.cc \
- dlink.h \
- errorpage.cc \
- event.cc \
- external_acl.cc \
+ tests/stub_cache_manager.cc \
+ tests/stub_cbdata.cc \
+ tests/stub_client_side.cc \
+ tests/stub_debug.cc \
+ tests/stub_event.cc \
tests/stub_fatal.cc \
- fatal.h \
- fd.cc \
- fd.h \
- fde.cc \
- fqdncache.cc \
- fqdncache.h \
- fs_io.cc \
- fs_io.h \
- helper.cc \
- hier_code.h \
- http.cc \
- icp_v2.cc \
- icp_v3.cc \
- int.cc \
- int.h \
- internal.cc \
- internal.h \
- tests/stub_ipc_Forwarder.cc \
- ipcache.cc \
- tests/stub_libauth.cc \
- tests/stub_libauth_acls.cc \
- tests/stub_libdiskio.cc \
+ tests/stub_libdns.cc \
tests/stub_liberror.cc \
- tests/stub_libeui.cc \
- tests/stub_libmem.cc \
- tests/stub_libsecurity.cc \
- tests/stub_libstore.cc \
- tests/stub_main_cc.cc \
- mem_node.cc \
- mime.cc \
- mime.h \
+ tests/stub_libformat.cc \
+ tests/stub_liblog.cc \
+ tests/stub_libtime.cc \
mime_header.cc \
- mime_header.h \
- multicast.cc \
- multicast.h \
- neighbors.cc \
- neighbors.h \
- pconn.cc \
- peer_digest.cc \
- peer_proxy_negotiate_auth.cc \
- peer_proxy_negotiate_auth.h \
- peer_select.cc \
- peer_sourcehash.cc \
- peer_sourcehash.h \
- peer_userhash.cc \
- peer_userhash.h \
- tests/stub_redirect.cc \
- redirect.h \
- refresh.cc \
- refresh.h \
- repl_modules.h \
- stat.cc \
- stat.h \
- stmem.cc \
- store.cc \
- store_client.cc \
- tests/stub_store_digest.cc \
- store_digest.h \
- store_io.cc \
- store_key_md5.cc \
- store_key_md5.h \
- store_log.cc \
- store_log.h \
- store_rebuild.cc \
- store_rebuild.h \
- tests/stub_store_stats.cc \
- store_swapin.cc \
- store_swapin.h \
- store_swapout.cc \
- tools.cc \
- tools.h \
- tests/stub_tunnel.cc \
- tunnel.h \
- urn.cc \
- urn.h \
- tests/stub_wccp2.cc \
- wccp2.h \
- wordlist.cc \
- wordlist.h
-nodist_tests_testHttpRequest_SOURCES = \
- $(BUILT_SOURCES) \
- tests/stub_libtime.cc
+ tests/stub_neighbors.cc \
+ tests/stub_store.cc \
+ tests/stub_store_stats.cc
tests_testHttpRequest_LDADD = \
- libsquid.la \
- clients/libclients.la \
- servers/libservers.la \
- helper/libhelper.la \
- ftp/libftp.la \
- http/libhttp.la \
- acl/libacls.la \
- acl/libstate.la \
- acl/libapi.la \
- parser/libparser.la \
- fs/libfs.la \
- $(SSL_LIBS) \
- ipc/libipc.la \
- proxyp/libproxyp.la \
- parser/libparser.la \
- dns/libdns.la \
base/libbase.la \
- mgr/libmgr.la \
- html/libhtml.la \
- anyp/libanyp.la \
- $(SNMP_LIBS) \
- icmp/libicmp.la \
- comm/libcomm.la \
- ip/libip.la \
- log/liblog.la \
- format/libformat.la \
- store/libstore.la \
sbuf/libsbuf.la \
- debug/libdebug.la \
- $(REPL_OBJS) \
- $(ADAPTATION_LIBS) \
- $(top_builddir)/lib/libmisccontainers.la \
+ SquidConfig.o \
+ ip/libip.la \
+ parser/libparser.la \
+ mem/libmem.la \
+ http/libhttp.la \
+ anyp/libanyp.la \
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
- $(LIBCAP_LIBS) \
- $(LIBGNUTLS_LIBS) \
- $(LIBHEIMDAL_KRB5_LIBS) \
- $(REGEXLIB) \
- $(SSLLIB) \
- $(LIBCPPUNIT_LIBS) \
- $(LIBSYSTEMD_LIBS) \
$(COMPAT_LIB) \
- $(LIBGSS_LIBS) \
- $(LIBMIT_KRB5_LIBS) \
+ $(LIBCPPUNIT_LIBS) \
+ $(LIBGNUTLS_LIBS) \
$(LIBNETFILTER_CONNTRACK_LIBS) \
$(LIBNETTLE_LIBS) \
- $(LIBPSAPI_LIBS) \
+ $(SSLLIB) \
$(XTRA_LIBS)
tests_testHttpRequest_LDFLAGS = $(LIBADD_DL)
CBDATA_CLASS_INIT(ACLFilledChecklist);
-ACLFilledChecklist::ACLFilledChecklist() :
- dst_rdns(nullptr),
-#if USE_AUTH
- auth_user_request (nullptr),
-#endif
-#if SQUID_SNMP
- snmp_community(nullptr),
-#endif
- requestErrorType(ERR_MAX),
- conn_(nullptr),
- fd_(-1),
- destinationDomainChecked_(false),
- sourceDomainChecked_(false)
-{
- my_addr.setEmpty();
- src_addr.setEmpty();
- dst_addr.setEmpty();
-}
+ACLFilledChecklist::ACLFilledChecklist() = default;
ACLFilledChecklist::~ACLFilledChecklist()
{
* (XXX) or eventually/asynchronously. After this callback obligations are
* fulfilled, checkCallback() deletes the checklist object (i.e. "this").
*/
-ACLFilledChecklist::ACLFilledChecklist(const acl_access *A, HttpRequest *http_request):
- dst_rdns(nullptr),
-#if USE_AUTH
- auth_user_request(nullptr),
-#endif
-#if SQUID_SNMP
- snmp_community(nullptr),
-#endif
- requestErrorType(ERR_MAX),
- conn_(nullptr),
- fd_(-1),
- destinationDomainChecked_(false),
- sourceDomainChecked_(false)
+ACLFilledChecklist::ACLFilledChecklist(const acl_access * const A, HttpRequest * const http_request)
{
- my_addr.setEmpty();
- src_addr.setEmpty();
- dst_addr.setEmpty();
-
changeAcl(A);
setRequest(http_request);
}
Ip::Address dst_addr;
Ip::Address my_addr;
SBuf dst_peer_name;
- char *dst_rdns;
+ char *dst_rdns = nullptr;
HttpRequest::Pointer request;
Auth::UserRequest::Pointer auth_user_request;
#endif
#if SQUID_SNMP
- char *snmp_community;
+ char *snmp_community = nullptr;
#endif
// TODO: RefCount errors; do not ignore them because their "owner" is gone!
ExternalACLEntryPointer extacl_entry;
- err_type requestErrorType;
+ err_type requestErrorType = ERR_MAX;
private:
- ConnStateData *conn_; ///< hack: client-to-Squid connection manager (if any)
- int fd_; /**< may be available when conn_ is not */
+ ConnStateData *conn_ = nullptr; ///< hack: client-to-Squid connection manager (if any)
+ int fd_ = -1; /**< may be available when conn_ is not */
HttpReply::Pointer reply_; ///< response added by updateReply() or nil
- bool destinationDomainChecked_;
- bool sourceDomainChecked_;
+ bool destinationDomainChecked_ = false;
+ bool sourceDomainChecked_ = false;
/// not implemented; will cause link failures if used
ACLFilledChecklist(const ACLFilledChecklist &);
/// not implemented; will cause link failures if used
## This file is generated by scripts/source-maintenance.sh.
STUB_SOURCE = \
+ tests/stub_ACLFilledChecklist.cc \
tests/stub_CacheDigest.cc \
tests/stub_CachePeer.cc \
tests/stub_CollapsedForwarding.cc \
tests/stub_UdsOp.cc \
tests/stub_access_log.cc \
tests/stub_acl.cc \
+ tests/stub_adaptation_History.cc \
tests/stub_cache_cf.cc \
tests/stub_cache_manager.cc \
tests/stub_carp.cc \
tests/stub_libauth_acls.cc \
tests/stub_libcomm.cc \
tests/stub_libdiskio.cc \
+ tests/stub_libdns.cc \
tests/stub_liberror.cc \
tests/stub_libeui.cc \
tests/stub_libformat.cc \
--- /dev/null
+/*
+ * Copyright (C) 1996-2025 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.
+ */
+
+#include "squid.h"
+
+#define STUB_API "acl/FilledChecklist.cc"
+#include "tests/STUB.h"
+
+#include "ExternalACLEntry.h"
+
+#include "acl/FilledChecklist.h"
+// These stubs are not in tests/stub_acl.cc because ACLFilledChecklist requires
+// X509_free() and other heavy or difficult-to-stub dependencies that other
+// tests/stub_acl.cc users (e.g., testConfigParser) may not otherwise need.
+ACLFilledChecklist::ACLFilledChecklist() STUB
+ACLFilledChecklist::ACLFilledChecklist(const acl_access *, HttpRequest *) STUB
+ACLFilledChecklist::~ACLFilledChecklist() STUB
+void ACLFilledChecklist::syncAle(HttpRequest *, const char *) const STUB
+void ACLFilledChecklist::updateAle(const AccessLogEntry::Pointer &) STUB
+void ACLFilledChecklist::updateReply(const HttpReply::Pointer &) STUB
+void ACLFilledChecklist::verifyAle() const STUB
#define STUB_API "access.log.cc"
#include "tests/STUB.h"
-HierarchyLogEntry::HierarchyLogEntry() STUB
+HierarchyLogEntry::HierarchyLogEntry() STUB_NOP
void HierarchyLogEntry::notePeerRead() STUB
void HierarchyLogEntry::notePeerWrite() STUB
#include "tests/STUB.h"
#include "acl/forward.h"
+#include "acl/Tree.h"
#include "acl/Gadgets.h"
size_t aclParseAclList(ConfigParser &, ACLList **, const char *) STUB_RETVAL(0)
+void aclDestroyAclList(ACLList **) STUB
+const Acl::Tree &Acl::ToTree(const TreePointer *) STUB_RETREF(Acl::Tree)
+
+#include "acl/Checklist.h"
+ACLChecklist::ACLChecklist() STUB
+ACLChecklist::~ACLChecklist() STUB
+const Acl::Answer &ACLChecklist::fastCheck() STUB_RETREF(Acl::Answer)
+const Acl::Answer &ACLChecklist::fastCheck(const ACLList *) STUB_RETREF(Acl::Answer)
--- /dev/null
+/*
+ * Copyright (C) 1996-2025 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.
+ */
+
+#include "squid.h"
+
+#define STUB_API "adaptation/libadaptation.la"
+#include "tests/STUB.h"
+
+#if USE_ADAPTATION
+#include "adaptation/History.h"
+#endif
+#if ICAP_CLIENT
+#include "adaptation/icap/History.h"
+#endif
+
+#if ICAP_CLIENT
+int IcapLogfileStatus = LOG_DISABLE;
+Adaptation::Icap::History::History() STUB
+#endif
+
+#if USE_ADAPTATION
+Adaptation::History::History():
+ lastMeta(hoReply),
+ allMeta(hoReply),
+ theNextServices("")
+{
+ STUB_NOP
+}
+#endif
+
static SBuf nil;
const SBuf &AnyP::Uri::path() const STUB_RETVAL(nil)
void AnyP::Uri::addRelativePath(const char *) STUB
+char *urlCanonicalCleanWithoutRequest(const SBuf &, const HttpRequestMethod &, const AnyP::UriScheme &) STUB_RETVAL(nullptr)
const SBuf &AnyP::Uri::SlashPath()
{
static SBuf slash("/");
--- /dev/null
+/*
+ * Copyright (C) 1996-2025 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.
+ */
+
+#include "squid.h"
+
+#define STUB_API "dns/libdns.la"
+#include "tests/STUB.h"
+
+#include "dns/LookupDetails.h"
+
+std::ostream &Dns::LookupDetails::print(std::ostream &os) const STUB_RETVAL(os)
#include "squid.h"
#include "format/Format.h"
+#include "format/Quoting.h"
#define STUB_API "stub_libformat.cc"
#include "tests/STUB.h"
+const SBuf Format::Dash("-");
+
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
+char *Format::QuoteUrlEncodeUsername(const char *) STUB_RETVAL(nullptr)
+char *Format::QuoteMimeBlob(const char *) STUB_RETVAL(nullptr)