aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/OSHttpRequest.cs
diff options
context:
space:
mode:
authorDr Scofield2008-07-07 09:47:36 +0000
committerDr Scofield2008-07-07 09:47:36 +0000
commit7f0bcc5aa1f7afc0d24734978bfd784ae8ac1558 (patch)
tree1ead06aa0a5c7c7329b17d32509cff086126d99a /OpenSim/Framework/Servers/OSHttpRequest.cs
parentAddresses more problem box cut angles (diff)
downloadopensim-SC-7f0bcc5aa1f7afc0d24734978bfd784ae8ac1558.zip
opensim-SC-7f0bcc5aa1f7afc0d24734978bfd784ae8ac1558.tar.gz
opensim-SC-7f0bcc5aa1f7afc0d24734978bfd784ae8ac1558.tar.bz2
opensim-SC-7f0bcc5aa1f7afc0d24734978bfd784ae8ac1558.tar.xz
further progress on HttpServer integration: OSHttpRequest can now be
instantiated from both .NET and HttpServer code path.
Diffstat (limited to 'OpenSim/Framework/Servers/OSHttpRequest.cs')
-rw-r--r--OpenSim/Framework/Servers/OSHttpRequest.cs64
1 files changed, 45 insertions, 19 deletions
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs
index 1eb094e..f8f542b 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.Generic;
29using System.Collections.Specialized; 30using System.Collections.Specialized;
30using System.Net; 31using System.Net;
31using System.IO; 32using System.IO;
@@ -43,12 +44,12 @@ namespace OpenSim.Framework.Servers
43 private Encoding _contentEncoding; 44 private Encoding _contentEncoding;
44 private long _contentLength64; 45 private long _contentLength64;
45 private string _contentType; 46 private string _contentType;
46 private CookieCollection _cookies; 47 // private CookieCollection _cookies;
47 private NameValueCollection _headers; 48 private NameValueCollection _headers;
48 private string _httpMethod; 49 private string _httpMethod;
49 private Stream _inputStream; 50 private Stream _inputStream;
50 private bool _isSecureConnection; 51 // private bool _isSecureConnection;
51 private bool _isAuthenticated; 52 // private bool _isAuthenticated;
52 private bool _keepAlive; 53 private bool _keepAlive;
53 private bool _hasbody; 54 private bool _hasbody;
54 private string _rawUrl; 55 private string _rawUrl;
@@ -76,7 +77,7 @@ namespace OpenSim.Framework.Servers
76 77
77 public long ContentLength64 78 public long ContentLength64
78 { 79 {
79 get { return _contentLength64; } 80 get { return ContentLength; }
80 } 81 }
81 82
82 public string ContentType 83 public string ContentType
@@ -84,10 +85,11 @@ namespace OpenSim.Framework.Servers
84 get { return _contentType; } 85 get { return _contentType; }
85 } 86 }
86 87
87 public CookieCollection Cookies 88
88 { 89 // public CookieCollection Cookies
89 get { return _cookies; } 90 // {
90 } 91 // get { return _cookies; }
92 // }
91 93
92 public NameValueCollection Headers 94 public NameValueCollection Headers
93 { 95 {
@@ -104,15 +106,15 @@ namespace OpenSim.Framework.Servers
104 get { return _inputStream; } 106 get { return _inputStream; }
105 } 107 }
106 108
107 public bool IsSecureConnection 109 // public bool IsSecureConnection
108 { 110 // {
109 get { return _isSecureConnection; } 111 // get { return _isSecureConnection; }
110 } 112 // }
111 113
112 public bool IsAuthenticated 114 // public bool IsAuthenticated
113 { 115 // {
114 get { return _isAuthenticated; } 116 // get { return _isAuthenticated; }
115 } 117 // }
116 118
117 public bool HasEntityBody 119 public bool HasEntityBody
118 { 120 {
@@ -159,13 +161,13 @@ namespace OpenSim.Framework.Servers
159 _contentEncoding = req.ContentEncoding; 161 _contentEncoding = req.ContentEncoding;
160 _contentLength64 = req.ContentLength64; 162 _contentLength64 = req.ContentLength64;
161 _contentType = req.ContentType; 163 _contentType = req.ContentType;
162 _cookies = req.Cookies; 164 // _cookies = req.Cookies;
163 _headers = req.Headers; 165 _headers = req.Headers;
164 _httpMethod = req.HttpMethod; 166 _httpMethod = req.HttpMethod;
165 _hasbody = req.HasEntityBody; 167 _hasbody = req.HasEntityBody;
166 _inputStream = req.InputStream; 168 _inputStream = req.InputStream;
167 _isSecureConnection = req.IsSecureConnection; 169 // _isSecureConnection = req.IsSecureConnection;
168 _isAuthenticated = req.IsAuthenticated; 170 // _isAuthenticated = req.IsAuthenticated;
169 _keepAlive = req.KeepAlive; 171 _keepAlive = req.KeepAlive;
170 _rawUrl = req.RawUrl; 172 _rawUrl = req.RawUrl;
171 _url = req.Url; 173 _url = req.Url;
@@ -177,6 +179,30 @@ namespace OpenSim.Framework.Servers
177 { 179 {
178 // _context = context; 180 // _context = context;
179 _request = req; 181 _request = req;
182
183 _acceptTypes = req.AcceptTypes;
184 if (null != req.Headers["content-encoding"])
185 _contentEncoding = Encoding.GetEncoding(_request.Headers["content-encoding"]);
186 _contentLength64 = req.ContentLength;
187 if (null != req.Headers["content-type"])
188 _contentType = _request.Headers["content-type"];
189 // _cookies = req.Cookies;
190 _headers = req.Headers;
191 _httpMethod = req.Method;
192 _hasbody = req.ContentLength != 0;
193 _inputStream = req.Body;
194 // _isSecureConnection = req.IsSecureConnection;
195 // _isAuthenticated = req.IsAuthenticated;
196 _keepAlive = ConnectionType.KeepAlive == req.Connection;
197 _rawUrl = req.Uri.AbsolutePath;
198 _url = req.Uri;
199 if (null != req.Headers["user-agent"])
200 _userAgent = req.Headers["user-agent"];
201 _queryString = new NameValueCollection();
202 foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString)
203 {
204 _queryString.Add(q.Key, q.Value.Value);
205 }
180 } 206 }
181 } 207 }
182} 208}