1 karl 1.24 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 karl 1.18 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.14 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.18 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.20 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.24 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.11 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.2 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
|
21 kumpf 1.11 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 kumpf 1.11 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_HTTPMessage_h
35 #define Pegasus_HTTPMessage_h
36
37 #include <iostream>
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/Common/MessageQueue.h>
40 #include <Pegasus/Common/Pair.h>
41 #include <Pegasus/Common/String.h>
42 #include <Pegasus/Common/Message.h>
|
43 kumpf 1.13 #include <Pegasus/Common/ArrayInternal.h>
|
44 mike 1.2 #include <Pegasus/Common/AuthenticationInfo.h>
|
45 kumpf 1.12 #include <Pegasus/Common/Linkage.h>
|
46 kumpf 1.23 #include <Pegasus/Common/AcceptLanguageList.h>
47 #include <Pegasus/Common/ContentLanguageList.h>
|
48 mike 1.22 #include <Pegasus/Common/Buffer.h>
|
49 mike 1.2
50 PEGASUS_NAMESPACE_BEGIN
51
52 typedef Pair<String, String> HTTPHeader;
53
54 /** This message is sent from a connection to its output queue when
55 a complete HTTP message is received.
56 */
57 class PEGASUS_COMMON_LINKAGE HTTPMessage : public Message
58 {
|
59 kumpf 1.26 public:
|
60 kumpf 1.27
|
61 kumpf 1.26 typedef Message Base;
|
62 kumpf 1.27
|
63 kumpf 1.26 HTTPMessage(
64 const Buffer& message_,
65 Uint32 queueId_ = 0,
66 const CIMException* cimException_ = 0);
67
68 HTTPMessage(const HTTPMessage & msg);
69
70 Buffer message;
71 Uint32 queueId;
72 String ipAddress;
73 AuthenticationInfo* authInfo;
74 AcceptLanguageList acceptLanguages;
75 ContentLanguageList contentLanguages;
76 Boolean acceptLanguagesDecoded;
77 Boolean contentLanguagesDecoded;
78 CIMException cimException;
79
80 void parse(
81 String& startLine,
82 Array<HTTPHeader>& headers,
83 Uint32& contentLength) const;
84 kumpf 1.26
85 #ifdef PEGASUS_DEBUG
86 void printAll(PEGASUS_STD(ostream)& os) const;
87 #endif
88
89 static void lookupHeaderPrefix(
90 Array<HTTPHeader>& headers,
91 const String& fieldName,
92 String& prefix);
93
94 static Boolean lookupHeader(
95 Array<HTTPHeader>& headers,
96 const String& fieldName,
97 String& fieldValue,
98 Boolean allowNamespacePrefix = false);
99
100 static Boolean parseRequestLine(
101 const String& startLine,
102 String& methodName,
103 String& requestUri,
104 String& httpVersion);
105 kumpf 1.26
106 static Boolean parseStatusLine(
107 const String& statusLine,
108 String& httpVersion,
109 Uint32& statusCode,
110 String& reasonPhrase);
|
111 kumpf 1.4 };
|
112 kumpf 1.5
113 PEGASUS_NAMESPACE_END
|
114 mike 1.2
115 #endif /* Pegasus_HTTPMessage_h */
|