diff options
author | lbsa71 | 2007-07-03 14:37:29 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-03 14:37:29 +0000 |
commit | 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 (patch) | |
tree | 8d72120aac2184c5ed4c5ab5f6b673ef496a0803 /OpenSim/Framework/Servers/BaseHttpServer.cs | |
parent | * Completed conceptual LlsdMethod - everything resides in SimpleApp pending g... (diff) | |
download | opensim-SC-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.zip opensim-SC-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.gz opensim-SC-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.bz2 opensim-SC-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.xz |
* Optimized usings (the 'LL ate my scripts' commit)
* added some licensing info
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 5dc1f56..713793c 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -26,13 +26,14 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | ||
30 | using System.Net; | 32 | using System.Net; |
31 | using System.Text; | 33 | using System.Text; |
32 | using System.Text.RegularExpressions; | 34 | using System.Text.RegularExpressions; |
33 | using System.Threading; | 35 | using System.Threading; |
34 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
35 | using System.Collections; | ||
36 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
37 | 38 | ||
38 | namespace OpenSim.Framework.Servers | 39 | namespace OpenSim.Framework.Servers |
@@ -199,9 +200,9 @@ namespace OpenSim.Framework.Servers | |||
199 | response.KeepAlive = false; | 200 | response.KeepAlive = false; |
200 | response.SendChunked = false; | 201 | response.SendChunked = false; |
201 | 202 | ||
202 | System.IO.Stream body = request.InputStream; | 203 | Stream body = request.InputStream; |
203 | System.Text.Encoding encoding = System.Text.Encoding.UTF8; | 204 | Encoding encoding = Encoding.UTF8; |
204 | System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); | 205 | StreamReader reader = new StreamReader(body, encoding); |
205 | 206 | ||
206 | string requestBody = reader.ReadToEnd(); | 207 | string requestBody = reader.ReadToEnd(); |
207 | body.Close(); | 208 | body.Close(); |
@@ -245,8 +246,8 @@ namespace OpenSim.Framework.Servers | |||
245 | 246 | ||
246 | } | 247 | } |
247 | 248 | ||
248 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); | 249 | byte[] buffer = Encoding.UTF8.GetBytes(responseString); |
249 | System.IO.Stream output = response.OutputStream; | 250 | Stream output = response.OutputStream; |
250 | response.SendChunked = false; | 251 | response.SendChunked = false; |
251 | response.ContentLength64 = buffer.Length; | 252 | response.ContentLength64 = buffer.Length; |
252 | output.Write(buffer, 0, buffer.Length); | 253 | output.Write(buffer, 0, buffer.Length); |
@@ -260,7 +261,7 @@ namespace OpenSim.Framework.Servers | |||
260 | 261 | ||
261 | public void Start() | 262 | public void Start() |
262 | { | 263 | { |
263 | OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); | 264 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); |
264 | 265 | ||
265 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 266 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); |
266 | m_workerThread.IsBackground = true; | 267 | m_workerThread.IsBackground = true; |
@@ -271,7 +272,7 @@ namespace OpenSim.Framework.Servers | |||
271 | { | 272 | { |
272 | try | 273 | try |
273 | { | 274 | { |
274 | OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); | 275 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); |
275 | m_httpListener = new HttpListener(); | 276 | m_httpListener = new HttpListener(); |
276 | 277 | ||
277 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 278 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); |
@@ -286,7 +287,7 @@ namespace OpenSim.Framework.Servers | |||
286 | } | 287 | } |
287 | catch (Exception e) | 288 | catch (Exception e) |
288 | { | 289 | { |
289 | OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); | 290 | MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); |
290 | } | 291 | } |
291 | } | 292 | } |
292 | 293 | ||