]> 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 // Manages the header and the body of an HTTP message being worked on.
18 // Adaptation transactions use this class for virgin and adapted HTTP messages.
19 // TODO: remove this class after adding refcounted message pointers and
20 // after making sure nobody abruptly clears the HttpMsg::body_pipe pointer.
21 class Message
22 {
23
24 public:
25 typedef HttpMsg Header;
26
27 Message();
28 Message(Header *aHeader);
29 ~Message();
30
31 void clear();
32 void set(Header *aHeader);
33
34 static void ShortCircuit(Message &src, Message &dest);
35
36 public:
37 // virgin or adapted message being worked on
38 Header *header; // parsed HTTP status/request line and headers
39
40 /// Copy of header->body_pipe, in case somebody moves the original.
41 /// \todo Find and fix the code that moves (if any) and remove this.
42 BodyPipePointer body_pipe;
43
44 private:
45 Message(const Message &); // not implemented
46 Message &operator =(const Message &); // not implemented
47 };
48
49 } // namespace Adaptation;
50
51 // TODO: replace ICAPInOut with Adaptation::Message (adding one for "cause")
52
53 #endif /* SQUID__ADAPTATION__MESSAGE_H */