]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/adaptation/icap/icap_log.cc
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / adaptation / icap / icap_log.cc
index 7a1f4d93a40d2080ad37d57025053c8b21d7ec6b..44522f375242304b0493787d18954015656b81b6 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 1996-2023 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"
 #include "AccessLogEntry.h"
 #include "acl/FilledChecklist.h"
@@ -34,7 +42,7 @@ icapLogClose()
     for (log = Config.Log.icaplogs; log; log = log->next) {
         if (log->logfile) {
             logfileClose(log->logfile);
-            log->logfile = NULL;
+            log->logfile = nullptr;
         }
     }
 }
@@ -44,7 +52,7 @@ icapLogRotate()
 {
     for (CustomLog* log = Config.Log.icaplogs; log; log = log->next) {
         if (log->logfile) {
-            logfileRotate(log->logfile);
+            logfileRotate(log->logfile, Config.Log.rotateNumber);
         }
     }
 }
@@ -52,11 +60,12 @@ icapLogRotate()
 void icapLogLog(AccessLogEntry::Pointer &al)
 {
     if (IcapLogfileStatus == LOG_ENABLE) {
-        ACLFilledChecklist checklist(NULL, al->adapted_request, NULL);
+        ACLFilledChecklist checklist(nullptr, al->adapted_request, nullptr);
         if (al->reply) {
-            checklist.reply = al->reply;
+            checklist.reply = al->reply.getRaw();
             HTTPMSGLOCK(checklist.reply);
         }
         accessLogLogTo(Config.Log.icaplogs, al, &checklist);
     }
 }
+