]>
Commit | Line | Data |
---|---|---|
bbc27441 | 1 | /* |
f70aedc4 | 2 | * Copyright (C) 1996-2021 The Squid Software Foundation and contributors |
bbc27441 AJ |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
cb255235 AR |
9 | #ifndef SQUID__ADAPTATION__MESSAGE_H |
10 | #define SQUID__ADAPTATION__MESSAGE_H | |
11 | ||
8bf217bd | 12 | #include "base/RefCount.h" |
63df1d28 | 13 | #include "http/forward.h" |
8bfcfe3a | 14 | |
cb255235 | 15 | class BodyPipe; |
cb255235 AR |
16 | typedef RefCount<BodyPipe> BodyPipePointer; |
17 | ||
26ac0430 AJ |
18 | namespace Adaptation |
19 | { | |
cb255235 AR |
20 | |
21 | // Manages the header and the body of an HTTP message being worked on. | |
22 | // Adaptation transactions use this class for virgin and adapted HTTP messages. | |
d1649fba | 23 | // TODO: remove this class after adding refcounted message pointers and |
63df1d28 | 24 | // after making sure nobody abruptly clears the Http::Message::body_pipe pointer. |
cb255235 AR |
25 | class Message |
26 | { | |
27 | ||
28 | public: | |
63df1d28 | 29 | typedef Http::Message Header; |
cb255235 AR |
30 | |
31 | Message(); | |
32 | Message(Header *aHeader); | |
33 | ~Message(); | |
34 | ||
35 | void clear(); | |
36 | void set(Header *aHeader); | |
37 | ||
26ac0430 | 38 | static void ShortCircuit(Message &src, Message &dest); |
cb255235 AR |
39 | |
40 | public: | |
41 | // virgin or adapted message being worked on | |
42 | Header *header; // parsed HTTP status/request line and headers | |
43 | ||
bcc947cd | 44 | /// Copy of header->body_pipe, in case somebody moves the original. |
9837567d | 45 | /// TODO: Find and fix the code that moves (if any) and remove this. |
26ac0430 | 46 | BodyPipePointer body_pipe; |
cb255235 AR |
47 | |
48 | private: | |
49 | Message(const Message &); // not implemented | |
50 | Message &operator =(const Message &); // not implemented | |
51 | }; | |
52 | ||
53 | } // namespace Adaptation; | |
54 | ||
55 | // TODO: replace ICAPInOut with Adaptation::Message (adding one for "cause") | |
56 | ||
57 | #endif /* SQUID__ADAPTATION__MESSAGE_H */ | |
f53969cc | 58 |