]>
Commit | Line | Data |
---|---|---|
cb255235 AR |
1 | |
2 | /* | |
3 | * $Id$ | |
4 | */ | |
5 | ||
6 | #ifndef SQUID__ADAPTATION__MESSAGE_H | |
7 | #define SQUID__ADAPTATION__MESSAGE_H | |
8 | ||
8bfcfe3a AR |
9 | #include "RefCount.h" |
10 | ||
cb255235 AR |
11 | class HttpMsg; |
12 | class BodyPipe; | |
cb255235 AR |
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. | |
d1649fba AR |
19 | // TODO: remove this class after adding refcounted message pointers and |
20 | // after making sure nobody abruptly clears the HttpMsg::body_pipe pointer. | |
cb255235 AR |
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 | ||
d1649fba | 34 | static void ShortCircuit(Message &src, Message &dest); |
cb255235 AR |
35 | |
36 | public: | |
37 | // virgin or adapted message being worked on | |
38 | Header *header; // parsed HTTP status/request line and headers | |
39 | ||
bcc947cd AR |
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. | |
cb255235 AR |
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 */ |