]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/IntervalAction.cc
paranoid_hit_validation directive (#559)
[thirdparty/squid.git] / src / mgr / IntervalAction.cc
index 6ab1230a4e64b7022d025a783f597228180f485f..13bfc4b862c4de5aa3e3bbf4f7fdc370f0708fe7 100644 (file)
@@ -1,26 +1,28 @@
 /*
- * $Id$
- *
- * DEBUG: section 16    Cache Manager API
+ * Copyright (C) 1996-2020 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.
  */
 
+/* DEBUG: section 16    Cache Manager API */
+
 #include "squid.h"
 #include "base/TextException.h"
 #include "ipc/Messages.h"
 #include "ipc/TypedMsgHdr.h"
 #include "mgr/IntervalAction.h"
-#include "protos.h"
 #include "SquidMath.h"
 #include "Store.h"
 #include "tools.h"
 
-extern void GetAvgStat(Mgr::IntervalActionData& stats, int minutes, int hours);
-extern void DumpAvgStat(Mgr::IntervalActionData& stats, StoreEntry* sentry);
+void GetAvgStat(Mgr::IntervalActionData& stats, int minutes, int hours);
+void DumpAvgStat(Mgr::IntervalActionData& stats, StoreEntry* sentry);
 
 Mgr::IntervalActionData::IntervalActionData()
 {
-    xmemset(this, 0, sizeof(*this));
+    memset(this, 0, sizeof(*this));
 }
 
 Mgr::IntervalActionData&
@@ -83,6 +85,11 @@ Mgr::IntervalActionData::operator += (const IntervalActionData& stats)
     swap_ins += stats.swap_ins;
     swap_files_cleaned += stats.swap_files_cleaned;
     aborted_requests += stats.aborted_requests;
+    hitValidationAttempts += stats.hitValidationAttempts;
+    hitValidationRefusalsDueToLocking += stats.hitValidationRefusalsDueToLocking;
+    hitValidationRefusalsDueToZeroSize += stats.hitValidationRefusalsDueToZeroSize;
+    hitValidationRefusalsDueToTimeLimit += stats.hitValidationRefusalsDueToTimeLimit;
+    hitValidationFailures += stats.hitValidationFailures;
     syscalls_disk_opens += stats.syscalls_disk_opens;
     syscalls_disk_closes += stats.syscalls_disk_closes;
     syscalls_disk_reads += stats.syscalls_disk_reads;
@@ -118,8 +125,8 @@ Mgr::IntervalAction::Create60min(const CommandPointer &cmd)
     return new IntervalAction(cmd, 60, 0);
 }
 
-Mgr::IntervalAction::IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours):
-        Action(cmd), minutes(aMinutes), hours(aHours), data()
+Mgr::IntervalAction::IntervalAction(const CommandPointer &aCmd, int aMinutes, int aHours):
+    Action(aCmd), minutes(aMinutes), hours(aHours), data()
 {
     debugs(16, 5, HERE);
 }
@@ -158,3 +165,4 @@ Mgr::IntervalAction::unpack(const Ipc::TypedMsgHdr& msg)
     msg.checkType(Ipc::mtCacheMgrResponse);
     msg.getPod(data);
 }
+