]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/adaptation/ServiceFilter.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / adaptation / ServiceFilter.cc
index 095cd2a383d150e2060058088ac9a32445cecc24..ab28271885f2d437556a85683942f000b2967ebc 100644 (file)
@@ -1,23 +1,44 @@
-#include "squid-old.h"
-#include "HttpRequest.h"
-#include "HttpReply.h"
-#include "adaptation/ServiceFilter.h"
+/*
+ * Copyright (C) 1996-2018 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 "adaptation/ServiceFilter.h"
+#include "HttpReply.h"
+#include "HttpRequest.h"
 
-Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint,
-        HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
-        request(HTTPMSGLOCK(aReq)),
-        reply(aRep ? HTTPMSGLOCK(aRep) : NULL)
+Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint, HttpRequest *aReq, HttpReply *aRep, AccessLogEntry::Pointer const &alp):
+    method(aMethod),
+    point(aPoint),
+    request(aReq),
+    reply(aRep),
+    al(alp)
 {
+    if (reply)
+        HTTPMSGLOCK(reply);
+
     // a lot of code assumes that there is always a virgin request or cause
     assert(request);
+    HTTPMSGLOCK(request);
 }
 
 Adaptation::ServiceFilter::ServiceFilter(const ServiceFilter &f):
-        method(f.method), point(f.point),
-        request(HTTPMSGLOCK(f.request)),
-        reply(f.reply ? HTTPMSGLOCK(f.reply) : NULL)
+    method(f.method),
+    point(f.point),
+    request(f.request),
+    reply(f.reply),
+    al(f.al)
 {
+    if (request)
+        HTTPMSGLOCK(request);
+
+    if (reply)
+        HTTPMSGLOCK(reply);
 }
 
 Adaptation::ServiceFilter::~ServiceFilter()
@@ -33,8 +54,12 @@ Adaptation::ServiceFilter &Adaptation::ServiceFilter::operator =(const ServiceFi
         point = f.point;
         HTTPMSGUNLOCK(request);
         HTTPMSGUNLOCK(reply);
-        request = HTTPMSGLOCK(f.request);
-        reply = f.reply ? HTTPMSGLOCK(f.reply) : NULL;
+        request = f.request;
+        HTTPMSGLOCK(request);
+        reply = f.reply;
+        if (reply)
+            HTTPMSGLOCK(reply);
     }
     return *this;
 }
+