]>
Commit | Line | Data |
---|---|---|
1adcebc3 | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 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; | |
bf95c10a | 21 | debugs(93, 4, "error: " << final); |
1adcebc3 AR |
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; | |
bf95c10a | 30 | debugs(93, 4, "forwarding: " << (void*)aMsg); |
1adcebc3 AR |
31 | return answer; |
32 | } | |
33 | ||
1adcebc3 | 34 | Adaptation::Answer |
25aa6c9a | 35 | Adaptation::Answer::Block(const SBuf &aRule) |
1adcebc3 AR |
36 | { |
37 | Answer answer(akBlock); | |
38 | answer.ruleId = aRule; | |
bf95c10a | 39 | debugs(93, 4, "blocking rule: " << aRule); |
1adcebc3 AR |
40 | return answer; |
41 | } | |
42 | ||
25aa6c9a AR |
43 | Acl::Answer |
44 | Adaptation::Answer::blockedToChecklistAnswer() const | |
45 | { | |
46 | assert(kind == akBlock); | |
47 | Acl::Answer answer(ACCESS_DENIED); | |
48 | answer.lastCheckedName = ruleId; | |
49 | return answer; | |
50 | } | |
51 | ||
1adcebc3 AR |
52 | std::ostream & |
53 | Adaptation::Answer::print(std::ostream &os) const | |
54 | { | |
55 | return os << kind; // TODO: add more details | |
56 | } | |
57 | ||
58 | Adaptation::Answer::Answer(Kind aKind): final(true), kind(aKind) | |
59 | { | |
60 | } | |
f53969cc | 61 |