1 kumpf 1.11 //%/////////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 kumpf 1.11 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
|
4 mike 1.2 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 kumpf 1.11 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10 mike 1.2 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
|
13 kumpf 1.11 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
16 kumpf 1.11 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19 mike 1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
|
26 kumpf 1.4 // Modified By: Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
27 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
28 mike 1.2 //
29 //%/////////////////////////////////////////////////////////////////////////////
30
31 #ifndef Pegasus_HTTPMessage_h
32 #define Pegasus_HTTPMessage_h
33
34 #include <iostream>
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/MessageQueue.h>
37 #include <Pegasus/Common/Pair.h>
38 #include <Pegasus/Common/String.h>
39 #include <Pegasus/Common/Message.h>
40 #include <Pegasus/Common/Array.h>
41 #include <Pegasus/Common/AuthenticationInfo.h>
|
42 kumpf 1.12 #include <Pegasus/Common/Linkage.h>
|
43 mike 1.2
44 PEGASUS_NAMESPACE_BEGIN
45
46 typedef Pair<String, String> HTTPHeader;
47
48 /** This message is sent from a connection to its output queue when
49 a complete HTTP message is received.
50 */
51 class PEGASUS_COMMON_LINKAGE HTTPMessage : public Message
52 {
|
53 mday 1.3 public:
54
55 typedef Message Base;
56
57 HTTPMessage(const Array<Sint8>& message_, Uint32 queueId_ = 0);
58
59 HTTPMessage(HTTPMessage & msg);
60
61 Array<Sint8> message;
62 Uint32 queueId;
63 AuthenticationInfo* authInfo;
64
65 void parse(
66 String& startLine,
67 Array<HTTPHeader>& headers,
68 Uint32& contentLength) const;
69
70 void printAll(PEGASUS_STD(ostream)& os) const;
71
72 static Boolean lookupHeader(
73 Array<HTTPHeader>& headers,
74 mday 1.3 const String& fieldName,
75 String& fieldValue,
|
76 kumpf 1.8 Boolean allowNamespacePrefix = false);
|
77 mday 1.3
78 static Boolean parseRequestLine(
79 const String& startLine,
80 String& methodName,
81 String& requestUri,
82 String& httpVersion);
|
83 kumpf 1.4
84 static Boolean parseStatusLine(
85 const String& statusLine,
86 String& httpVersion,
87 Uint32& statusCode,
88 String& reasonPhrase);
89 };
|
90 kumpf 1.5
91 PEGASUS_NAMESPACE_END
|
92 mike 1.2
93 #endif /* Pegasus_HTTPMessage_h */
|