Answer.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/* DEBUG: section 93 ICAP (RFC 3507) Client */
10
11#include "squid.h"
12#include "adaptation/Answer.h"
13#include "base/AsyncJobCalls.h"
14#include "http/Message.h"
15
18{
19 Answer answer(akError);
20 answer.final = final;
21 debugs(93, 4, "error: " << final);
22 return answer;
23}
24
27{
28 Answer answer(akForward);
29 answer.message = aMsg;
30 debugs(93, 4, "forwarding: " << (void*)aMsg);
31 return answer;
32}
33
36{
37 Answer answer(akBlock);
38 answer.ruleId = aRule;
39 debugs(93, 4, "blocking rule: " << aRule);
40 return answer;
41}
42
43std::ostream &
44Adaptation::Answer::print(std::ostream &os) const
45{
46 return os << kind; // TODO: add more details
47}
48
49Adaptation::Answer::Answer(Kind aKind): final(true), kind(aKind)
50{
51}
52
summarizes adaptation service answer for the noteAdaptationAnswer() API
Definition: Answer.h:23
String ruleId
ACL (or similar rule) name that blocked forwarding.
Definition: Answer.h:40
static Answer Forward(Http::Message *aMsg)
create an akForward answer
Definition: Answer.cc:26
static Answer Error(bool final)
create an akError answer
Definition: Answer.cc:17
static Answer Block(const String &aRule)
create an akBlock answer
Definition: Answer.cc:35
std::ostream & print(std::ostream &os) const
Definition: Answer.cc:44
Http::MessagePointer message
HTTP request or response to forward.
Definition: Answer.h:39
Answer(Kind aKind)
use static creators instead
Definition: Answer.cc:49
bool final
whether the error, if any, cannot be bypassed
Definition: Answer.h:41
Kind
helps interpret other members without a class hierarchy
Definition: Answer.h:26
@ akError
no adapted message will come; see bypassable
Definition: Answer.h:29
common parts of HttpRequest and HttpReply
Definition: Message.h:26
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:194

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors