]> git.ipfire.org Git - thirdparty/squid.git/blame - src/adaptation/ServiceFilter.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / adaptation / ServiceFilter.cc
CommitLineData
582c2af2 1#include "squid.h"
a22e6cd3
AR
2#include "HttpRequest.h"
3#include "HttpReply.h"
4#include "adaptation/ServiceFilter.h"
5
a22e6cd3 6Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint,
e1381638
AJ
7 HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
8 request(HTTPMSGLOCK(aReq)),
9 reply(aRep ? HTTPMSGLOCK(aRep) : NULL)
a22e6cd3
AR
10{
11 // a lot of code assumes that there is always a virgin request or cause
12 assert(request);
13}
14
15Adaptation::ServiceFilter::ServiceFilter(const ServiceFilter &f):
e1381638
AJ
16 method(f.method), point(f.point),
17 request(HTTPMSGLOCK(f.request)),
18 reply(f.reply ? HTTPMSGLOCK(f.reply) : NULL)
a22e6cd3
AR
19{
20}
21
22Adaptation::ServiceFilter::~ServiceFilter()
23{
24 HTTPMSGUNLOCK(request);
25 HTTPMSGUNLOCK(reply);
26}
27
28Adaptation::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}