toSpend/1e3, 0, false);
DiskerHandleMoreRequestsScheduled = true;
return true;
- } else
- if (balance < -maxImbalance) {
+ } else if (balance < -maxImbalance) {
// do not owe "too much" to avoid "too large" bursts of I/O
balance = -maxImbalance;
}
bool grokkedUri = false;
bool onOverloadSet = false;
std::set<std::string> options;
-
+
while (char *option = strtok(NULL, w_space)) {
const char *name = option;
const char *value = "";
// Check if option is set twice
if (options.find(name) != options.end()) {
- debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " <<
+ debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " <<
"Duplicate option \"" << name << "\" in adaptation service definition");
return false;
}
// is the service URI set?
if (!grokkedUri) {
- debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " <<
+ debugs(3, DBG_CRITICAL, cfg_filename << ':' << config_lineno << ": " <<
"No \"uri\" option in adaptation service definition");
return false;
}
}
void
-ConnStateData::expectNoForwarding() {
+ConnStateData::expectNoForwarding()
+{
if (bodyPipe != NULL) {
debugs(33, 4, HERE << "no consumer for virgin body " << bodyPipe->status());
bodyPipe->expectNoConsumption();
const bool wontEvenWorkWithoutDisker = Config.workers > 1;
const bool wouldWorkBetterWithDisker = DiskIOModule::Find("IpcIo");
return InDaemonMode() && (wontEvenWorkWithoutDisker ||
- wouldWorkBetterWithDisker);
+ wouldWorkBetterWithDisker);
}
void
// warn if maximum db size is not reachable due to sfileno limit
if (entryLimitAllowed() == entryLimitHigh() &&
- diskWasteSize >= maxRoundingWaste) {
+ diskWasteSize >= maxRoundingWaste) {
debugs(47, DBG_CRITICAL, "Rock store cache_dir[" << index << "] '" << path << "':");
debugs(47, DBG_CRITICAL, "\tmaximum number of entries: " << entryLimitAllowed());
debugs(47, DBG_CRITICAL, "\tmaximum object size: " << maxObjectSize() << " Bytes");
// Do not start I/O transaction if there are less than 10% free pages left.
// TODO: reserve page instead
if (needsDiskStrand() &&
- Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) {
+ Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) {
debugs(47, 5, HERE << "too few shared pages for IPC I/O left");
return false;
}
// Do not start I/O transaction if there are less than 10% free pages left.
// TODO: reserve page instead
if (needsDiskStrand() &&
- Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) {
+ Ipc::Mem::PageLevel(Ipc::Mem::PageId::ioPage) >= 0.9 * Ipc::Mem::PageLimit(Ipc::Mem::PageId::ioPage)) {
debugs(47, 5, HERE << "too few shared pages for IPC I/O left");
return NULL;
}
static SegmentMap Segments;
Ipc::Mem::Segment::Segment(const char *const id):
- theName(id), theMem(NULL), theSize(0), theReserved(0), doUnlink(false)
+ theName(id), theMem(NULL), theSize(0), theReserved(0), doUnlink(false)
{
}
#define HERE "(ssl_crtd) " << __FILE__ << ':' << __LINE__ << ": "
Ssl::Lock::Lock(std::string const &aFilename) :
- filename(aFilename),
+ filename(aFilename),
#if _SQUID_MSWIN_
- hFile(INVALID_HANDLE_VALUE)
+ hFile(INVALID_HANDLE_VALUE)
#else
- fd(-1)
+ fd(-1)
#endif
{
}
}
void Ssl::Lock::unlock()
-{
+{
#if _SQUID_MSWIN_
if (hFile != INVALID_HANDLE_VALUE) {
UnlockFile(hFile, 0, 0, 1, 0);
unlock();
}
-Ssl::Locker::Locker(Lock &aLock, const char *aFileName, int aLineNo):
- weLocked(false), lock(aLock), fileName(aFileName), lineNo(aLineNo)
+Ssl::Locker::Locker(Lock &aLock, const char *aFileName, int aLineNo):
+ weLocked(false), lock(aLock), fileName(aFileName), lineNo(aLineNo)
{
if (!lock.locked()) {
lock.lock();
namespace Ssl
{
/// maintains an exclusive blocking file-based lock
-class Lock {
+class Lock
+{
public:
explicit Lock(std::string const &filename); ///< creates an unlocked lock
~Lock(); ///< releases the lock if it is locked
bool weLocked; ///< whether we locked the lock
Lock &lock; ///< the lock we are operating on
const std::string fileName; ///< where the lock was needed
- const int lineNo; ///< where the lock was needed
+ const int lineNo; ///< where the lock was needed
};
/// convenience macro to pass source code location to Locker and others