]>
Commit | Line | Data |
---|---|---|
1adcebc3 | 1 | /* |
77b1029d | 2 | * Copyright (C) 1996-2020 The Squid Software Foundation and contributors |
bbc27441 AJ |
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. | |
1adcebc3 AR |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 93 ICAP (RFC 3507) Client */ |
10 | ||
f7f3304a | 11 | #include "squid.h" |
1adcebc3 AR |
12 | #include "adaptation/Answer.h" |
13 | #include "base/AsyncJobCalls.h" | |
63df1d28 | 14 | #include "http/Message.h" |
1adcebc3 AR |
15 | |
16 | Adaptation::Answer | |
17 | Adaptation::Answer::Error(bool final) | |
18 | { | |
19 | Answer answer(akError); | |
20 | answer.final = final; | |
21 | debugs(93, 4, HERE << "error: " << final); | |
22 | return answer; | |
23 | } | |
24 | ||
25 | Adaptation::Answer | |
63df1d28 | 26 | Adaptation::Answer::Forward(Http::Message *aMsg) |
1adcebc3 AR |
27 | { |
28 | Answer answer(akForward); | |
29 | answer.message = aMsg; | |
30 | debugs(93, 4, HERE << "forwarding: " << (void*)aMsg); | |
31 | return answer; | |
32 | } | |
33 | ||
1adcebc3 AR |
34 | Adaptation::Answer |
35 | Adaptation::Answer::Block(const String &aRule) | |
36 | { | |
37 | Answer answer(akBlock); | |
38 | answer.ruleId = aRule; | |
39 | debugs(93, 4, HERE << "blocking rule: " << aRule); | |
40 | return answer; | |
41 | } | |
42 | ||
43 | std::ostream & | |
44 | Adaptation::Answer::print(std::ostream &os) const | |
45 | { | |
46 | return os << kind; // TODO: add more details | |
47 | } | |
48 | ||
49 | Adaptation::Answer::Answer(Kind aKind): final(true), kind(aKind) | |
50 | { | |
51 | } | |
f53969cc | 52 |