]> git.ipfire.org Git - thirdparty/squid.git/blame - src/adaptation/Answer.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / adaptation / Answer.cc
CommitLineData
1adcebc3 1/*
4ac4a490 2 * Copyright (C) 1996-2017 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"
14
15Adaptation::Answer
16Adaptation::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
24Adaptation::Answer
25Adaptation::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
1adcebc3
AR
33Adaptation::Answer
34Adaptation::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
42std::ostream &
43Adaptation::Answer::print(std::ostream &os) const
44{
45 return os << kind; // TODO: add more details
46}
47
48Adaptation::Answer::Answer(Kind aKind): final(true), kind(aKind)
49{
50}
f53969cc 51