]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ServiceFilter.cc
Merged from trunk
[thirdparty/squid.git] / src / adaptation / ServiceFilter.cc
1 #include "squid.h"
2 #include "HttpRequest.h"
3 #include "HttpReply.h"
4 #include "adaptation/ServiceFilter.h"
5
6 Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint,
7 HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
8 request(HTTPMSGLOCK(aReq)),
9 reply(aRep ? HTTPMSGLOCK(aRep) : NULL)
10 {
11 // a lot of code assumes that there is always a virgin request or cause
12 assert(request);
13 }
14
15 Adaptation::ServiceFilter::ServiceFilter(const ServiceFilter &f):
16 method(f.method), point(f.point),
17 request(HTTPMSGLOCK(f.request)),
18 reply(f.reply ? HTTPMSGLOCK(f.reply) : NULL)
19 {
20 }
21
22 Adaptation::ServiceFilter::~ServiceFilter()
23 {
24 HTTPMSGUNLOCK(request);
25 HTTPMSGUNLOCK(reply);
26 }
27
28 Adaptation::ServiceFilter &Adaptation::ServiceFilter::operator =(const ServiceFilter &f)
29 {
30 if (this != &f) {
31 method = f.method;
32 point = f.point;
33 HTTPMSGUNLOCK(request);
34 HTTPMSGUNLOCK(reply);
35 request = HTTPMSGLOCK(f.request);
36 reply = f.reply ? HTTPMSGLOCK(f.reply) : NULL;
37 }
38 return *this;
39 }