From 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 3 Jul 2007 14:37:29 +0000 Subject: * Optimized usings (the 'LL ate my scripts' commit) * added some licensing info --- OpenSim/Framework/Servers/BaseHttpServer.cs | 19 ++++++++-------- OpenSim/Framework/Servers/CheckSumServer.cs | 15 ------------- OpenSim/Framework/Servers/ILlsdMethodHandler.cs | 30 ++++++++++++++++++++++--- OpenSim/Framework/Servers/LlsdMethod.cs | 30 ++++++++++++++++++++++--- OpenSim/Framework/Servers/RestMethod.cs | 4 ---- OpenSim/Framework/Servers/UDPServerBase.cs | 8 ------- OpenSim/Framework/Servers/XmlRpcMethod.cs | 1 - 7 files changed, 64 insertions(+), 43 deletions(-) (limited to 'OpenSim/Framework/Servers') 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 @@ * */ using System; +using System.Collections; using System.Collections.Generic; +using System.IO; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading; using Nwc.XmlRpc; -using System.Collections; using OpenSim.Framework.Console; namespace OpenSim.Framework.Servers @@ -199,9 +200,9 @@ namespace OpenSim.Framework.Servers response.KeepAlive = false; response.SendChunked = false; - System.IO.Stream body = request.InputStream; - System.Text.Encoding encoding = System.Text.Encoding.UTF8; - System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); + Stream body = request.InputStream; + Encoding encoding = Encoding.UTF8; + StreamReader reader = new StreamReader(body, encoding); string requestBody = reader.ReadToEnd(); body.Close(); @@ -245,8 +246,8 @@ namespace OpenSim.Framework.Servers } - byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); - System.IO.Stream output = response.OutputStream; + byte[] buffer = Encoding.UTF8.GetBytes(responseString); + Stream output = response.OutputStream; response.SendChunked = false; response.ContentLength64 = buffer.Length; output.Write(buffer, 0, buffer.Length); @@ -260,7 +261,7 @@ namespace OpenSim.Framework.Servers public void Start() { - OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); + MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); m_workerThread = new Thread(new ThreadStart(StartHTTP)); m_workerThread.IsBackground = true; @@ -271,7 +272,7 @@ namespace OpenSim.Framework.Servers { try { - OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); + MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); m_httpListener = new HttpListener(); m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); @@ -286,7 +287,7 @@ namespace OpenSim.Framework.Servers } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); + MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); } } diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs index 6aeb58c..104de94 100644 --- a/OpenSim/Framework/Servers/CheckSumServer.cs +++ b/OpenSim/Framework/Servers/CheckSumServer.cs @@ -25,21 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Text; -using System.IO; -using System.Threading; -using System.Net; -using System.Net.Sockets; -using System.Timers; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; -using libsecondlife.Packets; -using OpenSim.Framework.Console; - - namespace OpenSim.Framework.Servers { /* public class CheckSumServer : UDPServerBase diff --git a/OpenSim/Framework/Servers/ILlsdMethodHandler.cs b/OpenSim/Framework/Servers/ILlsdMethodHandler.cs index f5daa8d..5382f2d 100644 --- a/OpenSim/Framework/Servers/ILlsdMethodHandler.cs +++ b/OpenSim/Framework/Servers/ILlsdMethodHandler.cs @@ -1,6 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Text; +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ namespace OpenSim.Framework.Servers { diff --git a/OpenSim/Framework/Servers/LlsdMethod.cs b/OpenSim/Framework/Servers/LlsdMethod.cs index bf58a71..d17fa38 100644 --- a/OpenSim/Framework/Servers/LlsdMethod.cs +++ b/OpenSim/Framework/Servers/LlsdMethod.cs @@ -1,6 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Text; +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ namespace OpenSim.Framework.Servers { diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs index a2b6bf0..c6cb230 100644 --- a/OpenSim/Framework/Servers/RestMethod.cs +++ b/OpenSim/Framework/Servers/RestMethod.cs @@ -25,10 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Framework.Servers { public delegate string RestMethod( string request, string path, string param ); diff --git a/OpenSim/Framework/Servers/UDPServerBase.cs b/OpenSim/Framework/Servers/UDPServerBase.cs index 2617c56..508eb9d 100644 --- a/OpenSim/Framework/Servers/UDPServerBase.cs +++ b/OpenSim/Framework/Servers/UDPServerBase.cs @@ -26,16 +26,8 @@ * */ using System; -using System.Text; -using System.IO; -using System.Threading; using System.Net; using System.Net.Sockets; -using System.Timers; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using libsecondlife; using libsecondlife.Packets; namespace OpenSim.Framework.Servers diff --git a/OpenSim/Framework/Servers/XmlRpcMethod.cs b/OpenSim/Framework/Servers/XmlRpcMethod.cs index 51b3303..b76ac51 100644 --- a/OpenSim/Framework/Servers/XmlRpcMethod.cs +++ b/OpenSim/Framework/Servers/XmlRpcMethod.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; using Nwc.XmlRpc; namespace OpenSim.Framework.Servers -- cgit v1.1