]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/Message.h
Merged from trunk
[thirdparty/squid.git] / src / adaptation / Message.h
1 #ifndef SQUID__ADAPTATION__MESSAGE_H
2 #define SQUID__ADAPTATION__MESSAGE_H
3
4 #include "base/RefCount.h"
5
6 class HttpMsg;
7 class BodyPipe;
8 typedef RefCount<BodyPipe> BodyPipePointer;
9
10 namespace Adaptation
11 {
12
13 // Manages the header and the body of an HTTP message being worked on.
14 // Adaptation transactions use this class for virgin and adapted HTTP messages.
15 // TODO: remove this class after adding refcounted message pointers and
16 // after making sure nobody abruptly clears the HttpMsg::body_pipe pointer.
17 class Message
18 {
19
20 public:
21 typedef HttpMsg Header;
22
23 Message();
24 Message(Header *aHeader);
25 ~Message();
26
27 void clear();
28 void set(Header *aHeader);
29
30 static void ShortCircuit(Message &src, Message &dest);
31
32 public:
33 // virgin or adapted message being worked on
34 Header *header; // parsed HTTP status/request line and headers
35
36 /// Copy of header->body_pipe, in case somebody moves the original.
37 /// \todo Find and fix the code that moves (if any) and remove this.
38 BodyPipePointer body_pipe;
39
40 private:
41 Message(const Message &); // not implemented
42 Message &operator =(const Message &); // not implemented
43 };
44
45 } // namespace Adaptation;
46
47 // TODO: replace ICAPInOut with Adaptation::Message (adding one for "cause")
48
49 #endif /* SQUID__ADAPTATION__MESSAGE_H */