]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Answer.h
1 #ifndef SQUID_ADAPTATION__ANSWER_H
2 #define SQUID_ADAPTATION__ANSWER_H
4 #include "adaptation/forward.h"
12 /// summarizes adaptation service answer for the noteAdaptationAnswer() API
16 /// helps interpret other members without a class hierarchy
18 akForward
, ///< forward the supplied adapted HTTP message
19 akBlock
, ///< block or deny the master xaction; see authority
20 akError
, ///< no adapted message will come; see bypassable
23 static Answer
Error(bool final
); ///< create an akError answer
24 static Answer
Forward(HttpMsg
*aMsg
); ///< create an akForward answer
25 static Answer
Block(const String
&aRule
); ///< create an akBlock answer
27 std::ostream
&print(std::ostream
&os
) const;
30 HttpMsgPointerT
<HttpMsg
> message
; ///< HTTP request or response to forward
31 String ruleId
; ///< ACL (or similar rule) name that blocked forwarding
32 bool final
; ///< whether the error, if any, cannot be bypassed
33 Kind kind
; ///< the type of the answer
36 explicit Answer(Kind aKind
); ///< use static creators instead
40 std::ostream
&operator <<(std::ostream
&os
, const Answer
&answer
)
42 return answer
.print(os
);
45 } // namespace Adaptation
47 #endif /* SQUID_ADAPTATION__ANSWER_H */