]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/adaptation/Iterator.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / adaptation / Iterator.h
index 586532ac6eb82472b8b091cd290e2a180db485c8..9c2be5764cf097c6e2d9f97a18875d504ea98e3f 100644 (file)
@@ -1,9 +1,19 @@
+/*
+ * Copyright (C) 1996-2021 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.
+ */
+
 #ifndef SQUID_ADAPTATION__ITERATOR_H
 #define SQUID_ADAPTATION__ITERATOR_H
 
-#include "adaptation/Initiator.h"
+#include "AccessLogEntry.h"
 #include "adaptation/Initiate.h"
+#include "adaptation/Initiator.h"
 #include "adaptation/ServiceGroups.h"
+#include "http/forward.h"
 
 namespace Adaptation
 {
@@ -20,8 +30,11 @@ namespace Adaptation
 /// iterates services in ServiceGroup, starting adaptation launchers
 class Iterator: public Initiate, public Initiator
 {
+    CBDATA_CLASS(Iterator);
+
 public:
-    Iterator(HttpMsg *virginHeader, HttpRequest *virginCause,
+    Iterator(Http::Message *virginHeader, HttpRequest *virginCause,
+             AccessLogEntry::Pointer &alp,
              const Adaptation::ServiceGroupPointer &aGroup);
     virtual ~Iterator();
 
@@ -46,22 +59,21 @@ protected:
     /// creates service filter for the current step
     ServiceFilter filter() const;
 
-    void handleAdaptedHeader(HttpMsg *msg);
+    void handleAdaptedHeader(Http::Message *msg);
     void handleAdaptationBlock(const Answer &answer);
     void handleAdaptationError(bool final);
 
     ServiceGroupPointer theGroup; ///< the service group we are iterating
     ServicePlan thePlan; ///< which services to use and in what order
-    HttpMsg *theMsg; ///< the message being adapted (virgin for each step)
+    Http::Message *theMsg; ///< the message being adapted (virgin for each step)
     HttpRequest *theCause; ///< the cause of the original virgin message
+    AccessLogEntry::Pointer al; ///< info for the future access.log entry
     CbcPointer<Adaptation::Initiate> theLauncher; ///< current transaction launcher
     int iterations; ///< number of steps initiated
     bool adapted; ///< whether the virgin message has been replaced
-
-    CBDATA_CLASS2(Iterator);
 };
 
 } // namespace Adaptation
 
-
 #endif /* SQUID_ADAPTATION__ITERATOR_H */
+