Answer.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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, HERE << "error: " << final);
22  return answer;
23 }
24 
27 {
28  Answer answer(akForward);
29  answer.message = aMsg;
30  debugs(93, 4, HERE << "forwarding: " << (void*)aMsg);
31  return answer;
32 }
33 
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 }
52 
summarizes adaptation service answer for the noteAdaptationAnswer() API
Definition: Answer.h:22
static Answer Error(bool final)
create an akError answer
Definition: Answer.cc:17
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
Http::MessagePointer message
HTTP request or response to forward.
Definition: Answer.h:39
static Answer Block(const String &aRule)
create an akBlock answer
Definition: Answer.cc:35
no adapted message will come; see bypassable
Definition: Answer.h:29
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
#define true
Definition: GnuRegex.c:234
Answer(Kind aKind)
use static creators instead
Definition: Answer.cc:49
common parts of HttpRequest and HttpReply
Definition: Message.h:24
Kind
helps interpret other members without a class hierarchy
Definition: Answer.h:26
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:147
bool final
whether the error, if any, cannot be bypassed
Definition: Answer.h:41
std::ostream & print(std::ostream &os) const
Definition: Answer.cc:44

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors