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