aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/OSHttpRequest.cs
diff options
context:
space:
mode:
authorDr Scofield2008-07-17 16:51:23 +0000
committerDr Scofield2008-07-17 16:51:23 +0000
commit6ca23c112342d1027f135a9da3423bc85699e433 (patch)
tree892a0974d664298e88d7345b9309dac3262089c3 /OpenSim/Framework/Servers/OSHttpRequest.cs
parentMantis#1736. Thank you kindly, StrawberryFride for a patch that: (diff)
downloadopensim-SC_OLD-6ca23c112342d1027f135a9da3423bc85699e433.zip
opensim-SC_OLD-6ca23c112342d1027f135a9da3423bc85699e433.tar.gz
opensim-SC_OLD-6ca23c112342d1027f135a9da3423bc85699e433.tar.bz2
opensim-SC_OLD-6ca23c112342d1027f135a9da3423bc85699e433.tar.xz
rearranging variables in OSHttpRequest and adding Query property.
Diffstat (limited to 'OpenSim/Framework/Servers/OSHttpRequest.cs')
-rw-r--r--OpenSim/Framework/Servers/OSHttpRequest.cs67
1 files changed, 45 insertions, 22 deletions
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs
index 7549f08..0a82a04 100644
--- a/OpenSim/Framework/Servers/OSHttpRequest.cs
+++ b/OpenSim/Framework/Servers/OSHttpRequest.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.Collections.Specialized; 31using System.Collections.Specialized;
31using System.Net; 32using System.Net;
@@ -37,131 +38,150 @@ namespace OpenSim.Framework.Servers
37{ 38{
38 public class OSHttpRequest 39 public class OSHttpRequest
39 { 40 {
40 /// <remarks>
41 /// soon to be deprecated
42 /// </remarks>
43 private string[] _acceptTypes;
44 private Encoding _contentEncoding;
45 private long _contentLength64;
46 private string _contentType;
47 // private CookieCollection _cookies;
48 private NameValueCollection _headers;
49 private string _httpMethod;
50 private Stream _inputStream;
51 // private bool _isSecureConnection;
52 // private bool _isAuthenticated;
53 private bool _keepAlive;
54 private bool _hasbody;
55 private string _rawUrl;
56 private Uri _url;
57 private NameValueCollection _queryString;
58 private string _userAgent;
59 private IPEndPoint _ipEndPoint;
60 41
61 private HttpRequest _request;
62 private HttpClientContext _context;
63 42
64 public string[] AcceptTypes 43 public string[] AcceptTypes
65 { 44 {
66 get { return _acceptTypes; } 45 get { return _acceptTypes; }
67 } 46 }
47 private string[] _acceptTypes;
48
68 49
69 public Encoding ContentEncoding 50 public Encoding ContentEncoding
70 { 51 {
71 get { return _contentEncoding; } 52 get { return _contentEncoding; }
72 } 53 }
54 private Encoding _contentEncoding;
55
73 56
74 public long ContentLength 57 public long ContentLength
75 { 58 {
76 get { return _contentLength64; } 59 get { return _contentLength64; }
77 } 60 }
61 private long _contentLength64;
62
78 63
79 public long ContentLength64 64 public long ContentLength64
80 { 65 {
81 get { return ContentLength; } 66 get { return ContentLength; }
82 } 67 }
83 68
69
84 public string ContentType 70 public string ContentType
85 { 71 {
86 get { return _contentType; } 72 get { return _contentType; }
87 } 73 }
74 private string _contentType;
88 75
89 76
90 // public CookieCollection Cookies 77 // public CookieCollection Cookies
91 // { 78 // {
92 // get { return _cookies; } 79 // get { return _cookies; }
93 // } 80 // }
81 // private CookieCollection _cookies;
94 82
95 public NameValueCollection Headers 83 public NameValueCollection Headers
96 { 84 {
97 get { return _headers; } 85 get { return _headers; }
98 } 86 }
87 private NameValueCollection _headers;
99 88
100 public string HttpMethod 89 public string HttpMethod
101 { 90 {
102 get { return _httpMethod; } 91 get { return _httpMethod; }
103 } 92 }
93 private string _httpMethod;
94
104 95
105 public Stream InputStream 96 public Stream InputStream
106 { 97 {
107 get { return _inputStream; } 98 get { return _inputStream; }
108 } 99 }
100 private Stream _inputStream;
101
109 102
110 // public bool IsSecureConnection 103 // public bool IsSecureConnection
111 // { 104 // {
112 // get { return _isSecureConnection; } 105 // get { return _isSecureConnection; }
113 // } 106 // }
107 // private bool _isSecureConnection;
108
114 109
115 // public bool IsAuthenticated 110 // public bool IsAuthenticated
116 // { 111 // {
117 // get { return _isAuthenticated; } 112 // get { return _isAuthenticated; }
118 // } 113 // }
114 // private bool _isAuthenticated;
115
119 116
120 public bool HasEntityBody 117 public bool HasEntityBody
121 { 118 {
122 get { return _hasbody; } 119 get { return _hasbody; }
123 } 120 }
121 private bool _hasbody;
122
124 123
125 public bool KeepAlive 124 public bool KeepAlive
126 { 125 {
127 get { return _keepAlive; } 126 get { return _keepAlive; }
128 } 127 }
128 private bool _keepAlive;
129
129 130
130 public string RawUrl 131 public string RawUrl
131 { 132 {
132 get { return _rawUrl; } 133 get { return _rawUrl; }
133 } 134 }
135 private string _rawUrl;
136
134 137
135 public Uri Url 138 public Uri Url
136 { 139 {
137 get { return _url; } 140 get { return _url; }
138 } 141 }
142 private Uri _url;
143
139 144
140 public string UserAgent 145 public string UserAgent
141 { 146 {
142 get { return _userAgent; } 147 get { return _userAgent; }
143 } 148 }
149 private string _userAgent;
150
144 151
145 public NameValueCollection QueryString 152 public NameValueCollection QueryString
146 { 153 {
147 get { return _queryString; } 154 get { return _queryString; }
148 } 155 }
156 private NameValueCollection _queryString;
157
158 public Hashtable Query
159 {
160 get { return _query; }
161 }
162 private Hashtable _query;
163
149 164
150 public IPEndPoint RemoteIPEndPoint 165 public IPEndPoint RemoteIPEndPoint
151 { 166 {
152 get { return _ipEndPoint; } 167 get { return _ipEndPoint; }
153 } 168 }
169 private IPEndPoint _ipEndPoint;
154 170
155 171
156 internal HttpRequest HttpRequest 172 internal HttpRequest HttpRequest
157 { 173 {
158 get { return _request; } 174 get { return _request; }
159 } 175 }
176 private HttpRequest _request;
177
160 178
161 internal HttpClientContext HttpClientContext 179 internal HttpClientContext HttpClientContext
162 { 180 {
163 get { return _context; } 181 get { return _context; }
164 } 182 }
183 private HttpClientContext _context;
184
165 185
166 /// <summary> 186 /// <summary>
167 /// Internal whiteboard for handlers to store temporary stuff 187 /// Internal whiteboard for handlers to store temporary stuff
@@ -178,6 +198,7 @@ namespace OpenSim.Framework.Servers
178 { 198 {
179 } 199 }
180 200
201
181 public OSHttpRequest(HttpListenerRequest req) 202 public OSHttpRequest(HttpListenerRequest req)
182 { 203 {
183 _acceptTypes = req.AcceptTypes; 204 _acceptTypes = req.AcceptTypes;
@@ -221,9 +242,11 @@ namespace OpenSim.Framework.Servers
221 if (null != req.Headers["user-agent"]) 242 if (null != req.Headers["user-agent"])
222 _userAgent = req.Headers["user-agent"]; 243 _userAgent = req.Headers["user-agent"];
223 _queryString = new NameValueCollection(); 244 _queryString = new NameValueCollection();
245 _query = new Hashtable();
224 foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString) 246 foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString)
225 { 247 {
226 _queryString.Add(q.Key, q.Value.Value); 248 _queryString.Add(q.Key, q.Value.Value);
249 _query[q.Key] = q.Value.Value;
227 } 250 }
228 // TODO: requires change to HttpServer.HttpRequest 251 // TODO: requires change to HttpServer.HttpRequest
229 _ipEndPoint = null; 252 _ipEndPoint = null;