]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Answer.cc
Merge from trunk
[thirdparty/squid.git] / src / adaptation / Answer.cc
1 /*
2 * Copyright (C) 1996-2015 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 /* DEBUG: section 93 ICAP (RFC 3507) Client */
10
11 #include "squid.h"
12 #include "adaptation/Answer.h"
13 #include "base/AsyncJobCalls.h"
14
15 Adaptation::Answer
16 Adaptation::Answer::Error(bool final)
17 {
18 Answer answer(akError);
19 answer.final = final;
20 debugs(93, 4, HERE << "error: " << final);
21 return answer;
22 }
23
24 Adaptation::Answer
25 Adaptation::Answer::Forward(HttpMsg *aMsg)
26 {
27 Answer answer(akForward);
28 answer.message = aMsg;
29 debugs(93, 4, HERE << "forwarding: " << (void*)aMsg);
30 return answer;
31 }
32
33 Adaptation::Answer
34 Adaptation::Answer::Block(const String &aRule)
35 {
36 Answer answer(akBlock);
37 answer.ruleId = aRule;
38 debugs(93, 4, HERE << "blocking rule: " << aRule);
39 return answer;
40 }
41
42 std::ostream &
43 Adaptation::Answer::print(std::ostream &os) const
44 {
45 return os << kind; // TODO: add more details
46 }
47
48 Adaptation::Answer::Answer(Kind aKind): final(true), kind(aKind)
49 {
50 }
51