ServiceFilter.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "AccessLogEntry.h"
12#include "HttpReply.h"
13#include "HttpRequest.h"
14
16 method(aMethod),
17 point(aPoint),
18 request(aReq),
19 reply(aRep),
20 al(alp)
21{
22 if (reply)
24
25 // a lot of code assumes that there is always a virgin request or cause
28}
29
31 method(f.method),
32 point(f.point),
33 request(f.request),
34 reply(f.reply),
35 al(f.al)
36{
37 if (request)
39
40 if (reply)
42}
43
45{
46 HTTPMSGUNLOCK(request);
47 HTTPMSGUNLOCK(reply);
48}
49
51{
52 if (this != &f) {
53 method = f.method;
54 point = f.point;
55 HTTPMSGUNLOCK(request);
56 HTTPMSGUNLOCK(reply);
57 request = f.request;
58 HTTPMSGLOCK(request);
59 reply = f.reply;
60 if (reply)
61 HTTPMSGLOCK(reply);
62 }
63 return *this;
64}
65
66std::ostream &
67Adaptation::operator <<(std::ostream &os, const ServiceFilter &filter)
68{
69 os << methodStr(filter.method) << ' ' << vectPointStr(filter.point);
70 return os;
71}
72
#define assert(EX)
Definition: assert.h:17
information used to search for adaptation services
Definition: ServiceFilter.h:23
Method method
adaptation direction
Definition: ServiceFilter.h:32
VectPoint point
adaptation location
Definition: ServiceFilter.h:33
ServiceFilter(Method, VectPoint, HttpRequest *, HttpReply *, AccessLogEntry::Pointer const &al)
ServiceFilter & operator=(const ServiceFilter &f)
HttpRequest * request
HTTP request being adapted or cause; may be nil.
Definition: ServiceFilter.h:34
HttpReply * reply
HTTP response being adapted; may be nil.
Definition: ServiceFilter.h:35
void HTTPMSGUNLOCK(M *&a)
Definition: Message.h:150
void HTTPMSGLOCK(Http::Message *a)
Definition: Message.h:161
const char * vectPointStr(VectPoint)
Definition: Elements.cc:39
std::ostream & operator<<(std::ostream &os, const Answer &answer)
Definition: Answer.h:49
const char * methodStr(Method)
Definition: Elements.cc:15

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors