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