#endif
#endif /* SQUID_VERSION_H */
+
};
#endif /* SQUID_CACHEPEER_H_ */
+
timeval elapsedTime;
tvSub(elapsedTime, start, current_time);
os << "id: " << requestId <<
- ", offset: " << offset <<
- ", size: " << len <<
- ", workerPid: " << workerPid <<
- ", page: " << page <<
- ", command: " << command <<
- ", start: " << start <<
- ", elapsed: " << elapsedTime <<
- ", errno: " << xerrno;
+ ", offset: " << offset <<
+ ", size: " << len <<
+ ", workerPid: " << workerPid <<
+ ", page: " << page <<
+ ", command: " << command <<
+ ", start: " << start <<
+ ", elapsed: " << elapsedTime <<
+ ", errno: " << xerrno;
}
/* IpcIoPendingRequest */
!peer->options.originserver && // the "through a proxy" part
!peer->secure.encryptTransport) // the "exclude HTTPS proxies" part
return advanceDestination("establish tunnel through proxy", answer.conn, [this,&answer] {
- establishTunnelThruProxy(answer.conn);
- });
+ establishTunnelThruProxy(answer.conn);
+ });
}
secureConnectionToPeerIfNeeded(answer.conn);
StatCounters.h \
StatHist.cc \
StatHist.h \
- StoreFileSystem.cc \
tests/testStore.cc \
tests/testStore.h \
tests/testStoreController.cc \
tests/testStoreController.h \
+ StoreFileSystem.cc \
tests/testStoreHashIndex.cc \
tests/testStoreHashIndex.h \
StoreIOState.cc \
HttpRequest.cc \
tests/stub_HttpUpgradeProtocolAccess.cc \
IoStats.h \
+ tests/stub_IpcIoFile.cc \
LogTags.cc \
MasterXaction.cc \
MasterXaction.h \
event.cc \
tests/stub_external_acl.cc \
tests/stub_fatal.cc \
- tests/stub_IpcIoFile.cc \
fatal.h \
fd.cc \
fd.h \
tests/testHttpRequestMethod.h \
tests/stub_HttpUpgradeProtocolAccess.cc \
IoStats.h \
+ tests/stub_IpcIoFile.cc \
LogTags.cc \
MasterXaction.cc \
MasterXaction.h \
tests/stub_libsecurity.cc \
tests/stub_libstore.cc \
tests/stub_main_cc.cc \
- tests/stub_IpcIoFile.cc \
mem_node.cc \
mime.cc \
mime.h \
HttpRequest.cc \
tests/stub_HttpUpgradeProtocolAccess.cc \
IoStats.h \
+ tests/stub_IpcIoFile.cc \
LogTags.cc \
MasterXaction.cc \
MasterXaction.h \
tests/stub_libsecurity.cc \
tests/stub_libstore.cc \
tests/stub_main_cc.cc \
- tests/stub_IpcIoFile.cc \
mem_node.cc \
mime.cc \
mime.h \
HttpRequest.cc \
tests/stub_HttpUpgradeProtocolAccess.cc \
IoStats.h \
+ tests/stub_IpcIoFile.cc \
LogTags.cc \
MasterXaction.cc \
MasterXaction.h \
tests/stub_libsecurity.cc \
tests/stub_libstore.cc \
tests/stub_main_cc.cc \
- tests/stub_IpcIoFile.cc \
mem_node.cc \
mime.cc \
mime.h \
assert(entryLimit > 0);
Ipc::Mem::PageStack::Config spaceConfig;
- spaceConfig.poolId = Ipc::Mem::PageStack::IdForMemStoreSpace(),
+ spaceConfig.poolId = Ipc::Mem::PageStack::IdForMemStoreSpace();
spaceConfig.pageSize = 0; // the pages are stored in Ipc::Mem::Pages
spaceConfig.capacity = entryLimit;
spaceConfig.createFull = true; // all pages are initially available
{
const auto path = start();
const auto foundNextOrSpare = path != paths_.end() &&
- (currentPeer.getPeer() != path->connection->getPeer() || // next peer
- ConnectionFamily(currentPeer) != ConnectionFamily(*path->connection));
+ (currentPeer.getPeer() != path->connection->getPeer() || // next peer
+ ConnectionFamily(currentPeer) != ConnectionFamily(*path->connection));
return makeFinding(path, foundNextOrSpare);
}
return false;
});
const auto foundNext = path != paths_.end() &&
- primePeer != path->connection->getPeer();
+ primePeer != path->connection->getPeer();
return makeFinding(path, foundNext);
}
{
const auto path = start();
const auto foundNext = path != paths_.end() &&
- currentPeer.getPeer() != path->connection->getPeer();
+ currentPeer.getPeer() != path->connection->getPeer();
return makeFinding(path, foundNext);
}
if (position_ != npos)
os << " @" << position_;
}
+
/// reduces code duplication in Sum() declarations below
template <typename T, typename U>
using AllUnsigned = typename std::conditional<
- std::is_unsigned<T>::value && std::is_unsigned<U>::value,
- std::true_type,
- std::false_type
- >::type;
+ std::is_unsigned<T>::value && std::is_unsigned<U>::value,
+ std::true_type,
+ std::false_type
+ >::type;
/// \returns a non-overflowing sum of the two unsigned arguments (or nothing)
template <typename T, typename U, EnableIfType<AllUnsigned<T,U>::value, int> = 0>
// tests below avoid undefined behavior of signed under/overflows
return b >= 0 ?
- ((a > std::numeric_limits<U>::max() - b) ? Optional<T>() : Optional<T>(a + b)):
- ((a < std::numeric_limits<U>::min() - b) ? Optional<T>() : Optional<T>(a + b));
+ ((a > std::numeric_limits<U>::max() - b) ? Optional<T>() : Optional<T>(a + b)):
+ ((a < std::numeric_limits<U>::min() - b) ? Optional<T>() : Optional<T>(a + b));
}
/// \returns a non-overflowing sum of the arguments (or nothing)
// approximate calculation (e.g., containers store wrappers not value_types)
return Sum<uint64_t>(
- keySz,
- // storage
- sizeof(typename Entries::value_type),
- MemoryUsedBy(v),
- // index
- sizeof(typename Index::value_type));
+ keySz,
+ // storage
+ sizeof(typename Entries::value_type),
+ MemoryUsedBy(v),
+ // index
+ sizeof(typename Index::value_type));
}
template <class Key, class Value, uint64_t MemoryUsedBy(const Value &)>
template <class Key, class Value, uint64_t MemoryUsedBy(const Value &)>
ClpMap<Key, Value, MemoryUsedBy>::Entry::Entry(const Key &aKey, const Value &v, const Ttl ttl) :
- key(aKey),
- value(v),
- expires(Sum(squid_curtime, ttl).value_or(std::numeric_limits<time_t>::max()))
+ key(aKey),
+ value(v),
+ expires(Sum(squid_curtime, ttl).value_or(std::numeric_limits<time_t>::max()))
{
}
#endif /* SQUID__SRC_BASE_CLPMAP_H */
+
};
#endif /* SQUID__SRC_BASE_OPTIONAL_H */
+
const auto ccb = COMMIO_FD_WRITECB(head);
// check that the head descriptor is still relevant
if (headFde.clientInfo == this &&
- quotaPeekReserv() == ccb->quotaQueueReserv &&
- !headFde.closing()) {
+ quotaPeekReserv() == ccb->quotaQueueReserv &&
+ !headFde.closing()) {
// wait for the head descriptor to become ready for writing
Comm::SetSelect(head, COMM_SELECT_WRITE, Comm::HandleWrite, ccb, 0);
if (!fd_table[c->fd].halfClosedReader) { // not reading already
CallBack(fd_table[c->fd].codeContext, [&c] {
AsyncCall::Pointer call = commCbCall(5,4, "commHalfClosedReader",
- CommIoCbPtrFun(&commHalfClosedReader, nullptr));
+ CommIoCbPtrFun(&commHalfClosedReader, nullptr));
Comm::Read(c, call);
fd_table[c->fd].halfClosedReader = call;
});
Rock::Rebuild::Stats::completed(const SwapDir &sd) const
{
return DoneLoading(counts.scancount, sd.slotLimitActual()) &&
- DoneValidating(counts.validations, sd.slotLimitActual(), sd.entryLimitActual());
+ DoneValidating(counts.validations, sd.slotLimitActual(), sd.entryLimitActual());
}
/* Rebuild */
" from " << sd->filePath);
} else {
debugs(47, DBG_IMPORTANT, "Resuming indexing cache_dir #" << sd->index <<
- " from " << sd->filePath << ':' << progressDescription());
+ " from " << sd->filePath << ':' << progressDescription());
}
fd = file_open(sd->filePath, O_RDONLY | O_BINARY);
void helperStatefulShutdown(statefulhelper * hlp);
#endif /* SQUID_HELPER_H */
+
Ipc::OneToOneUniQueue::statOpen(std::ostream &os, const char *inLabel, const char *outLabel, const uint32_t count) const
{
os << "{ size: " << count <<
- ", capacity: " << theCapacity <<
- ", " << inLabel << ": " << theIn <<
- ", " << outLabel << ": " << theOut;
+ ", capacity: " << theCapacity <<
+ ", " << inLabel << ": " << theIn <<
+ ", " << outLabel << ": " << theOut;
}
/// end state reporting started by statOpen()
/* Are we eol? If so, prefix with our logfile command byte */
if (ll->eol == 1) {
- logfile_mod_daemon_append(lf, "L", 1);
- ll->eol = 0;
+ logfile_mod_daemon_append(lf, "L", 1);
+ ll->eol = 0;
}
/* Append this data to the end buffer; create a new one if needed */
template <class OtherValue>
struct rebind {
- typedef PoolingAllocator<OtherValue> other;
+ typedef PoolingAllocator<OtherValue> other;
};
template<class U, class ... Args> void construct(U *p, Args && ... args) { new((void *)p) U(std::forward<Args>(args)...); }
CallBack(selector->al, [selector,this] {
selector->ping.monitorRegistration = npos();
AsyncCall::Pointer callback = asyncCall(44, 4, "PeerSelector::HandlePingTimeout",
- cbdataDialer(PeerSelector::HandlePingTimeout, selector));
+ cbdataDialer(PeerSelector::HandlePingTimeout, selector));
ScheduleCallHere(callback);
});
selectors.erase(selectors.begin());
Ssl::ServerBio::encryptedCertificates() const
{
return parser_.details->tlsSupportedVersion &&
- Security::Tls1p3orLater(parser_.details->tlsSupportedVersion);
+ Security::Tls1p3orLater(parser_.details->tlsSupportedVersion);
}
/// initializes BIO table after allocation
stream << i->first << delimiter;
LocalContextStorage & ssl_store_policy(*(i->second));
const auto memoryPerEntry = ssl_store_policy.entries() ?
- ssl_store_policy.memoryUsed() / ssl_store_policy.entries() : 0;
+ ssl_store_policy.memoryUsed() / ssl_store_policy.entries() : 0;
stream << ssl_store_policy.memLimit() / 1024 << delimiter;
stream << ssl_store_policy.entries() << delimiter;
stream << memoryPerEntry / 1024 << delimiter;
#include "fs_io.h"
#include "helper/Reply.h"
#include "Parsing.h"
+#include "sbuf/Stream.h"
#include "SquidConfig.h"
#include "SquidString.h"
#include "SquidTime.h"
-#include "sbuf/Stream.h"
#include "ssl/cert_validate_message.h"
#include "ssl/Config.h"
#include "ssl/helper.h"
ttl = xatoi(token + 4);
if (ttl < 0) {
throw TextException(ToSBuf("Negative TTL in sslcrtvalidator_program ", Ssl::TheConfig.ssl_crt_validator,
- Debug::Extra, "For unlimited TTL, use ttl=infinity"),
- Here());
+ Debug::Extra, "For unlimited TTL, use ttl=infinity"),
+ Here());
}
continue;
} else if (strncmp(token, "cache=", 6) == 0) {
assert(e);
PackableStream stream(*e);
CollapsedForwarding::StatQueue(stream);
- #if HAVE_DISKIO_MODULE_IPCIO
+#if HAVE_DISKIO_MODULE_IPCIO
stream << "\n";
IpcIoFile::StatQueue(stream);
- #endif
+#endif
stream.flush();
}
#include "Store.h"
#include "store/Disk.h"
#include "store/Disks.h"
-#include "StoreFileSystem.h"
#include "store_rebuild.h"
+#include "StoreFileSystem.h"
#include "swap_log_op.h"
#include "tools.h"
#include "util.h" // for tvSubDsec() which should be in SquidTime.h
void
Store::Disks::Dump(const DiskConfig &swap, StoreEntry &entry, const char *name)
{
- for (int i = 0; i < swap.n_configured; ++i) {
- const auto &disk = Dir(i);
- storeAppendPrintf(&entry, "%s %s %s", name, disk.type(), disk.path);
- disk.dump(entry);
- storeAppendPrintf(&entry, "\n");
- }
+ for (int i = 0; i < swap.n_configured; ++i) {
+ const auto &disk = Dir(i);
+ storeAppendPrintf(&entry, "%s %s %s", name, disk.type(), disk.path);
+ disk.dump(entry);
+ storeAppendPrintf(&entry, "\n");
+ }
}
int64_t
void allocate_new_swapdir(Store::DiskConfig &swap);
void free_cachedir(Store::DiskConfig *swap);
-
/* Globals that should be moved to some Store::UFS-specific logging module */
void storeDirSwapLog(const StoreEntry *e, int op);
const auto savedPrecision = os.precision(2);
const auto percent = 100.0 * completed / goal;
os << percent << "% (" << completed << " out of " << goal << ")";
- (void)os.precision(savedPrecision);
+ (void)os.precision(savedPrecision);
} else if (!completed && !goal) {
os << "nothing to do";
} else {
## Please see the COPYING and CONTRIBUTORS files for details.
##
-STUB_SOURCE= \
- tests/stub_access_log.cc \
- tests/stub_acl.cc \
- tests/stub_cache_cf.cc \
- tests/stub_CacheDigest.cc \
- tests/stub_cache_manager.cc \
- tests/stub_CachePeer.cc \
- tests/stub_carp.cc \
- tests/stub_cbdata.cc \
- tests/stub_client_db.cc \
- tests/stub_client_side.cc \
- tests/stub_client_side_request.cc \
- tests/stub_CollapsedForwarding.cc \
- tests/stub_comm.cc \
- tests/stub_CommIO.cc \
- tests/stub_debug.cc \
- tests/stub_DelayId.cc \
- tests/stub_errorpage.cc \
- tests/stub_ETag.cc \
- tests/stub_event.cc \
- tests/stub_EventLoop.cc \
- tests/stub_external_acl.cc \
- tests/stub_fatal.cc \
- tests/stub_fd.cc \
- tests/stub_gopher.cc \
- tests/stub_helper.cc \
- tests/stub_HelperChildConfig.cc \
- tests/stub_http.cc \
- tests/stub_HttpControlMsg.cc \
- tests/stub_HttpHeader.cc \
- tests/stub_HttpReply.cc \
- tests/stub_HttpRequest.cc \
- tests/stub_HttpUpgradeProtocolAccess.cc \
- tests/stub_icp.cc \
- tests/stub_internal.cc \
- tests/stub_ipcache.cc \
- tests/stub_ipc.cc \
- tests/stub_ipc_Forwarder.cc \
- tests/stub_ipc_TypedMsgHdr.cc \
- tests/stub_libanyp.cc \
- tests/stub_libauth_acls.cc \
- tests/stub_libauth.cc \
- tests/stub_libcomm.cc \
- tests/stub_libdiskio.cc \
- tests/stub_libeui.cc \
- tests/stub_libformat.cc \
- tests/stub_libhttp.cc \
- tests/stub_libicmp.cc \
- tests/stub_libip.cc \
- tests/stub_liblog.cc \
- tests/stub_libmem.cc \
- tests/stub_libmgr.cc \
- tests/stub_libsecurity.cc \
- tests/stub_libsslsquid.cc \
- tests/stub_libstore.cc \
- tests/stub_main_cc.cc \
- tests/stub_MemBuf.cc \
- tests/stub_mem_node.cc \
- tests/stub_MemObject.cc \
- tests/stub_MemStore.cc \
- tests/stub_mime.cc \
- tests/stub_neighbors.cc \
- tests/stub_pconn.cc \
- tests/stub_Port.cc \
- tests/stub_redirect.cc \
- tests/stub_SBuf.cc \
- tests/stub_SBufDetailedStats.cc \
- tests/stub_stat.cc \
- tests/stub_StatHist.cc \
- tests/stub_stmem.cc \
- tests/stub_store.cc \
- tests/stub_store_client.cc \
- tests/stub_store_digest.cc \
- tests/stub_StoreMeta.cc \
- tests/stub_store_rebuild.cc \
- tests/stub_store_stats.cc \
- tests/stub_store_swapout.cc \
- tests/stub_time.cc \
- tests/stub_tools.cc \
- tests/stub_tunnel.cc \
- tests/stub_UdsOp.cc \
- tests/stub_wccp2.cc \
- tests/stub_whois.cc \
- tests/stub_wordlist.cc
+STUB_SOURCE = \
+ tests/stub_access_log.cc \
+ tests/stub_acl.cc \
+ tests/stub_cache_cf.cc \
+ tests/stub_CacheDigest.cc \
+ tests/stub_cache_manager.cc \
+ tests/stub_CachePeer.cc \
+ tests/stub_carp.cc \
+ tests/stub_cbdata.cc \
+ tests/stub_client_db.cc \
+ tests/stub_client_side.cc \
+ tests/stub_client_side_request.cc \
+ tests/stub_CollapsedForwarding.cc \
+ tests/stub_comm.cc \
+ tests/stub_CommIO.cc \
+ tests/stub_debug.cc \
+ tests/stub_DelayId.cc \
+ tests/stub_errorpage.cc \
+ tests/stub_ETag.cc \
+ tests/stub_event.cc \
+ tests/stub_EventLoop.cc \
+ tests/stub_external_acl.cc \
+ tests/stub_fatal.cc \
+ tests/stub_fd.cc \
+ tests/stub_gopher.cc \
+ tests/stub_helper.cc \
+ tests/stub_HelperChildConfig.cc \
+ tests/stub_http.cc \
+ tests/stub_HttpControlMsg.cc \
+ tests/stub_HttpHeader.cc \
+ tests/stub_HttpReply.cc \
+ tests/stub_HttpRequest.cc \
+ tests/stub_HttpUpgradeProtocolAccess.cc \
+ tests/stub_icp.cc \
+ tests/stub_internal.cc \
+ tests/stub_ipcache.cc \
+ tests/stub_ipc.cc \
+ tests/stub_ipc_Forwarder.cc \
+ tests/stub_IpcIoFile.cc \
+ tests/stub_ipc_TypedMsgHdr.cc \
+ tests/stub_libanyp.cc \
+ tests/stub_libauth_acls.cc \
+ tests/stub_libauth.cc \
+ tests/stub_libcomm.cc \
+ tests/stub_libdiskio.cc \
+ tests/stub_libeui.cc \
+ tests/stub_libformat.cc \
+ tests/stub_libhttp.cc \
+ tests/stub_libicmp.cc \
+ tests/stub_libip.cc \
+ tests/stub_liblog.cc \
+ tests/stub_libmem.cc \
+ tests/stub_libmgr.cc \
+ tests/stub_libsecurity.cc \
+ tests/stub_libsslsquid.cc \
+ tests/stub_libstore.cc \
+ tests/stub_main_cc.cc \
+ tests/stub_MemBuf.cc \
+ tests/stub_mem_node.cc \
+ tests/stub_MemObject.cc \
+ tests/stub_MemStore.cc \
+ tests/stub_mime.cc \
+ tests/stub_neighbors.cc \
+ tests/stub_pconn.cc \
+ tests/stub_Port.cc \
+ tests/stub_redirect.cc \
+ tests/stub_SBuf.cc \
+ tests/stub_SBufDetailedStats.cc \
+ tests/stub_stat.cc \
+ tests/stub_StatHist.cc \
+ tests/stub_stmem.cc \
+ tests/stub_store.cc \
+ tests/stub_store_client.cc \
+ tests/stub_store_digest.cc \
+ tests/stub_StoreMeta.cc \
+ tests/stub_store_rebuild.cc \
+ tests/stub_store_stats.cc \
+ tests/stub_store_swapout.cc \
+ tests/stub_time.cc \
+ tests/stub_tools.cc \
+ tests/stub_tunnel.cc \
+ tests/stub_UdsOp.cc \
+ tests/stub_wccp2.cc \
+ tests/stub_whois.cc \
+ tests/stub_wordlist.cc
#include "CachePeer.h"
time_t CachePeer::connectTimeout() const STUB_RETVAL(0)
+
Mem::Init();
AnyP::UriScheme::Init();
}
+
time.cc
nodist_cachemgr__CGIEXT__SOURCES = \
- tests/STUB.h \
tests/stub_cbdata.cc \
tests/stub_debug.cc \
- tests/stub_libmem.cc
+ tests/stub_libmem.cc \
+ tests/STUB.h
cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)