From f1f0bc23f4501ba99035283d3407ddad2b21b785 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 12 Sep 2010 13:43:49 -0400 Subject: Formatting cleanup. --- OpenSim/Framework/Capabilities/Caps.cs | 2 +- OpenSim/Framework/Console/CommandConsole.cs | 2 +- OpenSim/Framework/Console/LocalConsole.cs | 18 +-- OpenSim/Framework/LandData.cs | 28 ++--- OpenSim/Framework/LandUpdateArgs.cs | 14 +-- OpenSim/Framework/PrimitiveBaseShape.cs | 74 ++++++------- OpenSim/Framework/RegionInfo.cs | 28 ++--- .../Framework/Serialization/ArchiveConstants.cs | 20 ++-- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 121 ++++++++++----------- 9 files changed, 152 insertions(+), 155 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 8a339fe..6f32adf 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs @@ -760,7 +760,7 @@ namespace OpenSim.Framework.Capabilities string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); BakedTextureUploader uploader = - new BakedTextureUploader( capsBase + uploaderPath, + new BakedTextureUploader(capsBase + uploaderPath, m_httpListener); uploader.OnUpLoad += BakedTextureUploaded; diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index b17dbc0..52bcd55 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Console help.Add(commandInfo.descriptive_help); if (descriptiveHelp != string.Empty) - help.Add(string.Empty); + help.Add(string.Empty); } else { diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index c968031..6043094 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console { /// /// A console that uses cursor control and color - /// + /// public class LocalConsole : CommandConsole { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console private int SetCursorTop(int top) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor row position with a currently invalid column, mono will throw an exception. - // Therefore, we need to make sure that the column position is valid first. + // to set a cursor row position with a currently invalid column, mono will throw an exception. + // Therefore, we need to make sure that the column position is valid first. int left = System.Console.CursorLeft; if (left < 0) @@ -121,7 +121,7 @@ namespace OpenSim.Framework.Console { top = 0; } - else + else { int bh = System.Console.BufferHeight; @@ -133,7 +133,7 @@ namespace OpenSim.Framework.Console System.Console.CursorTop = top; return top; - } + } /// /// Set the cursor column. @@ -145,12 +145,12 @@ namespace OpenSim.Framework.Console /// /// /// The new cursor column. - /// + /// private int SetCursorLeft(int left) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor column position with a currently invalid row, mono will throw an exception. - // Therefore, we need to make sure that the row position is valid first. + // to set a cursor column position with a currently invalid row, mono will throw an exception. + // Therefore, we need to make sure that the row position is valid first. int top = System.Console.CursorTop; if (top < 0) @@ -214,7 +214,7 @@ namespace OpenSim.Framework.Console System.Console.Write("{0}", prompt); SetCursorTop(new_y); - SetCursorLeft(new_x); + SetCursorLeft(new_x); } } diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 8d3266b..accf52e 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -89,13 +89,13 @@ namespace OpenSim.Framework private Vector3 _userLocation = new Vector3(); private Vector3 _userLookAt = new Vector3(); private int _otherCleanTime = 0; - private string _mediaType = "none/none"; - private string _mediaDescription = ""; - private int _mediaHeight = 0; - private int _mediaWidth = 0; - private bool _mediaLoop = false; - private bool _obscureMusic = false; - private bool _obscureMedia = false; + private string _mediaType = "none/none"; + private string _mediaDescription = ""; + private int _mediaHeight = 0; + private int _mediaWidth = 0; + private bool _mediaLoop = false; + private bool _obscureMusic = false; + private bool _obscureMedia = false; /// /// Whether to obscure parcel media URL @@ -690,13 +690,13 @@ namespace OpenSim.Framework landData._userLocation = _userLocation; landData._userLookAt = _userLookAt; landData._otherCleanTime = _otherCleanTime; - landData._mediaType = _mediaType; - landData._mediaDescription = _mediaDescription; - landData._mediaWidth = _mediaWidth; - landData._mediaHeight = _mediaHeight; - landData._mediaLoop = _mediaLoop; - landData._obscureMusic = _obscureMusic; - landData._obscureMedia = _obscureMedia; + landData._mediaType = _mediaType; + landData._mediaDescription = _mediaDescription; + landData._mediaWidth = _mediaWidth; + landData._mediaHeight = _mediaHeight; + landData._mediaLoop = _mediaLoop; + landData._obscureMusic = _obscureMusic; + landData._obscureMedia = _obscureMedia; landData._parcelAccessList.Clear(); foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) diff --git a/OpenSim/Framework/LandUpdateArgs.cs b/OpenSim/Framework/LandUpdateArgs.cs index ed496a1..7d6c4f2 100644 --- a/OpenSim/Framework/LandUpdateArgs.cs +++ b/OpenSim/Framework/LandUpdateArgs.cs @@ -49,12 +49,12 @@ namespace OpenSim.Framework public UUID SnapshotID; public Vector3 UserLocation; public Vector3 UserLookAt; - public string MediaType; - public string MediaDescription; - public int MediaHeight; - public int MediaWidth; - public bool MediaLoop; - public bool ObscureMusic; - public bool ObscureMedia; + public string MediaType; + public string MediaDescription; + public int MediaHeight; + public int MediaWidth; + public bool MediaLoop; + public bool ObscureMusic; + public bool ObscureMedia; } } diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 70a61cc..0a81363 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -175,7 +175,7 @@ namespace OpenSim.Framework } } } - + /// /// Entries to store media textures on each face /// @@ -1216,28 +1216,28 @@ namespace OpenSim.Framework prim.Properties.Permissions = new Permissions(); prim.Properties.SalePrice = 10; prim.Properties.SaleType = new SaleType(); - + return prim; } - + /// /// Encapsulates a list of media entries. /// - /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more + /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more /// OSD like and less vulnerable to change. public class MediaList : List, IXmlSerializable - { + { public const string MEDIA_TEXTURE_TYPE = "sl"; - + public MediaList() : base() {} public MediaList(IEnumerable collection) : base(collection) {} public MediaList(int capacity) : base(capacity) {} - + public XmlSchema GetSchema() { return null; } - + public string ToXml() { lock (this) @@ -1245,78 +1245,78 @@ namespace OpenSim.Framework using (StringWriter sw = new StringWriter()) { using (XmlTextWriter xtw = new XmlTextWriter(sw)) - { + { xtw.WriteStartElement("OSMedia"); xtw.WriteAttributeString("type", MEDIA_TEXTURE_TYPE); xtw.WriteAttributeString("version", "0.1"); - + OSDArray meArray = new OSDArray(); foreach (MediaEntry me in this) { OSD osd = (null == me ? new OSD() : me.GetOSD()); meArray.Add(osd); - } - + } + xtw.WriteStartElement("OSData"); xtw.WriteRaw(OSDParser.SerializeLLSDXmlString(meArray)); xtw.WriteEndElement(); - + xtw.WriteEndElement(); - - xtw.Flush(); + + xtw.Flush(); return sw.ToString(); } - } - } + } + } } - + public void WriteXml(XmlWriter writer) - { + { writer.WriteRaw(ToXml()); } - + public static MediaList FromXml(string rawXml) { MediaList ml = new MediaList(); ml.ReadXml(rawXml); return ml; } - + public void ReadXml(string rawXml) - { + { using (StringReader sr = new StringReader(rawXml)) { using (XmlTextReader xtr = new XmlTextReader(sr)) - { + { xtr.MoveToContent(); - + string type = xtr.GetAttribute("type"); //m_log.DebugFormat("[MOAP]: Loaded media texture entry with type {0}", type); - + if (type != MEDIA_TEXTURE_TYPE) - return; - - xtr.ReadStartElement("OSMedia"); - + return; + + xtr.ReadStartElement("OSMedia"); + OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml()); foreach (OSD osdMe in osdMeArray) { MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry()); Add(me); } - - xtr.ReadEndElement(); + + xtr.ReadEndElement(); } } - } - + } + public void ReadXml(XmlReader reader) { if (reader.IsEmptyElement) return; - + ReadXml(reader.ReadInnerXml()); - } + } } - } -} \ No newline at end of file + } +} diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 12c58c3..08d5398 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -97,9 +97,9 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo - { + { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) /// @@ -344,7 +344,7 @@ namespace OpenSim.Framework public string proxyUrl = ""; public int ProxyOffset = 0; public string regionSecret = UUID.Random().ToString(); - + public string osSecret; public UUID lastMapUUID = UUID.Zero; @@ -699,7 +699,7 @@ namespace OpenSim.Framework RegionID = new UUID(regionUUID); originRegionID = RegionID; // What IS this?! - + RegionName = name; string location = config.GetString("Location", String.Empty); @@ -720,7 +720,7 @@ namespace OpenSim.Framework // Internal IP IPAddress address; - + if (config.Contains("InternalAddress")) { address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); @@ -774,7 +774,7 @@ namespace OpenSim.Framework { m_externalHostName = Util.GetLocalHost().ToString(); m_log.InfoFormat( - "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", + "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", m_externalHostName, name); } else @@ -909,16 +909,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", m_physPrimMax.ToString(), true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", m_clampPrimSize.ToString(), true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); - + configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", ScopeID.ToString(), true); @@ -956,16 +956,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); - + configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", "0", true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", "0", true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", "false", true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "0", true); diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index 3143e3b..7a9b33d 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs @@ -157,9 +157,9 @@ namespace OpenSim.Framework.Serialization public static string CreateOarObjectFilename(string objectName, UUID uuid, Vector3 pos) { return string.Format( - OAR_OBJECT_FILENAME_TEMPLATE, objectName, + OAR_OBJECT_FILENAME_TEMPLATE, objectName, Math.Round(pos.X), Math.Round(pos.Y), Math.Round(pos.Z), - uuid); + uuid); } /// @@ -171,9 +171,9 @@ namespace OpenSim.Framework.Serialization /// public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos) { - return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); - } - + return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); + } + /// /// Extract a plain path from an IAR path /// @@ -184,18 +184,18 @@ namespace OpenSim.Framework.Serialization List plainDirs = new List(); string[] iarDirs = iarPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - + foreach (string iarDir in iarDirs) { if (!iarDir.Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) plainDirs.Add(iarDir); - + int i = iarDir.LastIndexOf(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); plainDirs.Add(iarDir.Remove(i)); } - - return string.Join("/", plainDirs.ToArray()); + + return string.Join("/", plainDirs.ToArray()); } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index d20f8c9..452df38 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Servers.HttpServer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); - + private volatile int NotSocketErrors = 0; public volatile bool HTTPDRunning = false; @@ -160,7 +160,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_rpcHandlers[method] = handler; m_rpcHandlersKeepAlive[method] = keepAlive; // default } - + return true; } @@ -182,7 +182,7 @@ namespace OpenSim.Framework.Servers.HttpServer public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler) { //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName); - + lock (m_HTTPHandlers) { if (!m_HTTPHandlers.ContainsKey(methodName)) @@ -204,14 +204,14 @@ namespace OpenSim.Framework.Servers.HttpServer if (!m_pollHandlers.ContainsKey(methodName)) { m_pollHandlers.Add(methodName,args); - pollHandlerResult = true; + pollHandlerResult = true; } } - + if (pollHandlerResult) return AddHTTPHandler(methodName, handler); - return false; + return false; } // Note that the agent string is provided simply to differentiate @@ -257,51 +257,51 @@ namespace OpenSim.Framework.Servers.HttpServer { IHttpClientContext context = (IHttpClientContext)source; IHttpRequest request = args.Request; - + PollServiceEventArgs psEvArgs; - + if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); - + if (psEvArgs.Request != null) { OSHttpRequest req = new OSHttpRequest(context, request); - + Stream requestStream = req.InputStream; - + Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(requestStream, encoding); - + string requestBody = reader.ReadToEnd(); - + Hashtable keysvals = new Hashtable(); Hashtable headervals = new Hashtable(); - + string[] querystringkeys = req.QueryString.AllKeys; string[] rHeaders = req.Headers.AllKeys; - + keysvals.Add("body", requestBody); keysvals.Add("uri", req.RawUrl); keysvals.Add("content-type", req.ContentType); keysvals.Add("http-method", req.HttpMethod); - + foreach (string queryname in querystringkeys) { keysvals.Add(queryname, req.QueryString[queryname]); } - + foreach (string headername in rHeaders) { headervals[headername] = req.Headers[headername]; } - + keysvals.Add("headers", headervals); keysvals.Add("querystringkeys", querystringkeys); - + psEvArgs.Request(psreq.RequestID, keysvals); } - + m_PollServiceManager.Enqueue(psreq); } else @@ -348,10 +348,10 @@ namespace OpenSim.Framework.Servers.HttpServer { try { -// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); - +// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); - + // This is the REST agent interface. We require an agent to properly identify // itself. If the REST handler recognizes the prefix it will attempt to // satisfy the request. If it is not recognizable, and no damage has occurred @@ -456,7 +456,7 @@ namespace OpenSim.Framework.Servers.HttpServer } request.InputStream.Close(); - + // HTTP IN support. The script engine taes it from here // Nothing to worry about for us. // @@ -540,7 +540,7 @@ namespace OpenSim.Framework.Servers.HttpServer HandleLLSDRequests(request, response); return; } - + // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); if (DoWeHaveAHTTPHandler(request.RawUrl)) { @@ -594,7 +594,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } } - + if (String.IsNullOrEmpty(bestMatch)) { streamHandler = null; @@ -641,7 +641,7 @@ namespace OpenSim.Framework.Servers.HttpServer private bool TryGetHTTPHandler(string handlerKey, out GenericHTTPMethod HTTPHandler) { // m_log.DebugFormat("[BASE HTTP HANDLER]: Looking for HTTP handler for {0}", handlerKey); - + string bestMatch = null; lock (m_HTTPHandlers) @@ -727,14 +727,14 @@ namespace OpenSim.Framework.Servers.HttpServer { xmlRprcRequest.Params.Add(request.RemoteIPEndPoint); // Param[1] XmlRpcResponse xmlRpcResponse; - + XmlRpcMethod method; bool methodWasFound; lock (m_rpcHandlers) { methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method); } - + if (methodWasFound) { xmlRprcRequest.Params.Add(request.Url); // Param[2] @@ -766,10 +766,10 @@ namespace OpenSim.Framework.Servers.HttpServer else { xmlRpcResponse = new XmlRpcResponse(); - + // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php xmlRpcResponse.SetFault( - XmlRpcErrorCodes.SERVER_ERROR_METHOD, + XmlRpcErrorCodes.SERVER_ERROR_METHOD, String.Format("Requested method [{0}] not found", methodName)); } @@ -786,11 +786,11 @@ namespace OpenSim.Framework.Servers.HttpServer response.KeepAlive = false; m_log.ErrorFormat("[BASE HTTP SERVER]: Handler not found for http request {0}", request.RawUrl); - + response.SendChunked = false; response.ContentLength64 = buf.Length; response.ContentEncoding = Encoding.UTF8; - + try { response.OutputStream.Write(buf, 0, buf.Length); @@ -872,13 +872,13 @@ namespace OpenSim.Framework.Servers.HttpServer OSD llsdRequest = null; OSD llsdResponse = null; - + bool LegacyLLSDLoginLibOMV = (requestBody.Contains("passwd") && requestBody.Contains("mac") && requestBody.Contains("viewer_digest")); - + if (requestBody.Length == 0) // Get Request { - requestBody = "requestget"; + requestBody = "requestget"; } try { @@ -1090,7 +1090,7 @@ namespace OpenSim.Framework.Servers.HttpServer string bestMatch = null; //m_log.DebugFormat("[BASE HTTP HANDLER]: Checking if we have an HTTP handler for {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1156,7 +1156,7 @@ namespace OpenSim.Framework.Servers.HttpServer // You have to specifically register for '/' and to get it, you must specificaly request it // if (pattern == "/" && searchquery == "/" || pattern != "/") - bestMatch = pattern; + bestMatch = pattern; } } } @@ -1236,11 +1236,11 @@ namespace OpenSim.Framework.Servers.HttpServer } public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) - { + { // m_log.DebugFormat( -// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", +// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", // request.RawUrl, request.HttpMethod); - + switch (request.HttpMethod) { case "OPTIONS": @@ -1256,7 +1256,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void HandleContentVerbs(OSHttpRequest request, OSHttpResponse response) { // m_log.DebugFormat("[BASE HTTP SERVER]: HandleContentVerbs for request to {0}", request.RawUrl); - + // This is a test. There's a workable alternative.. as this way sucks. // We'd like to put this into a text file parhaps that's easily editable. // @@ -1391,7 +1391,7 @@ namespace OpenSim.Framework.Servers.HttpServer // m_log.DebugFormat( // "[BASE HTTP HANDLER]: TryGetHTTPHandlerPathBased() looking for HTTP handler to match {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1452,7 +1452,7 @@ namespace OpenSim.Framework.Servers.HttpServer //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this //and should check for NullReferenceExceptions - + if (string.IsNullOrEmpty(contentType)) { contentType = "text/html"; @@ -1472,8 +1472,8 @@ namespace OpenSim.Framework.Servers.HttpServer byte[] buffer; - if (!(contentType.Contains("image") - || contentType.Contains("x-shockwave-flash") + if (!(contentType.Contains("image") + || contentType.Contains("x-shockwave-flash") || contentType.Contains("application/x-oar"))) { // Text @@ -1504,7 +1504,7 @@ namespace OpenSim.Framework.Servers.HttpServer { response.OutputStream.Flush(); response.Send(); - + //if (!response.KeepAlive && response.ReuseContext) // response.FreeContext(); } @@ -1611,11 +1611,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port); m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.LogWriter = httpserverlog; - - // Uncomment this line in addition to those in HttpServerLogWriter + + // Uncomment this line in addition to those in HttpServerLogWriter // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else @@ -1643,8 +1643,8 @@ namespace OpenSim.Framework.Servers.HttpServer { m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message); m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?"); - - // We want this exception to halt the entire server since in current configurations we aren't too + + // We want this exception to halt the entire server since in current configurations we aren't too // useful without inbound HTTP. throw e; } @@ -1656,7 +1656,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case SocketError.NotSocket: NotSocketErrors++; - + break; } } @@ -1686,12 +1686,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2.LogWriter = null; m_httpListener2.RequestReceived -= OnRequest; m_httpListener2.Stop(); - } + } catch (NullReferenceException) { m_log.Warn("[BASE HTTP SERVER]: Null Reference when stopping HttpServer."); } - } public void RemoveStreamHandler(string httpMethod, string path) @@ -1712,7 +1711,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_HTTPHandlers.Remove(path); return; } - + m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } } @@ -1728,7 +1727,6 @@ namespace OpenSim.Framework.Servers.HttpServer } RemoveHTTPHandler(httpMethod, path); - } public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) @@ -1759,7 +1757,6 @@ namespace OpenSim.Framework.Servers.HttpServer } } - public bool RemoveLLSDHandler(string path, LLSDMethod handler) { try @@ -1833,7 +1830,7 @@ namespace OpenSim.Framework.Servers.HttpServer oresp = osresp; } } - + /// /// Relays HttpServer log messages to our own logging mechanism. /// @@ -1852,7 +1849,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case LogPrio.Trace: m_log.DebugFormat("[{0}]: {1}", source, message); - break; + break; case LogPrio.Debug: m_log.DebugFormat("[{0}]: {1}", source, message); break; @@ -1872,8 +1869,8 @@ namespace OpenSim.Framework.Servers.HttpServer break; } */ - + return; } } -} \ No newline at end of file +} -- cgit v1.1