aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-02 18:31:08 -0700
committerJohn Hurliman2009-10-02 18:31:08 -0700
commit387e9f7a7faeb412054383080afc3507a1522746 (patch)
tree522470dd28074f7e114547476968942c05e866aa /OpenSim/Framework
parentMerge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensi... (diff)
downloadopensim-SC-387e9f7a7faeb412054383080afc3507a1522746.zip
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.gz
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.bz2
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.xz
* Creates Util.UTF8 and switches some references of Encoding.UTF8 to Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework)
* Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization?
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AssetLandmark.cs2
-rw-r--r--OpenSim/Framework/Capabilities/LLSD.cs4
-rw-r--r--OpenSim/Framework/Capabilities/LLSDStreamHandler.cs2
-rw-r--r--OpenSim/Framework/Communications/XMPP/XmppWriter.cs2
-rw-r--r--OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Framework/Util.cs12
7 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs
index 7c87c34..fd7a2cd 100644
--- a/OpenSim/Framework/AssetLandmark.cs
+++ b/OpenSim/Framework/AssetLandmark.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Framework
49 49
50 private void InternData() 50 private void InternData()
51 { 51 {
52 string temp = Encoding.UTF8.GetString(Data).Trim(); 52 string temp = Util.UTF8.GetString(Data).Trim();
53 string[] parts = temp.Split('\n'); 53 string[] parts = temp.Split('\n');
54 int.TryParse(parts[0].Substring(17, 1), out Version); 54 int.TryParse(parts[0].Substring(17, 1), out Version);
55 UUID.TryParse(parts[1].Substring(10, 36), out RegionID); 55 UUID.TryParse(parts[1].Substring(10, 36), out RegionID);
diff --git a/OpenSim/Framework/Capabilities/LLSD.cs b/OpenSim/Framework/Capabilities/LLSD.cs
index 84f43c1..eec9e61 100644
--- a/OpenSim/Framework/Capabilities/LLSD.cs
+++ b/OpenSim/Framework/Capabilities/LLSD.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Framework.Capabilities
112 112
113 writer.Close(); 113 writer.Close();
114 114
115 return Encoding.UTF8.GetBytes(sw.ToString()); 115 return Util.UTF8.GetBytes(sw.ToString());
116 } 116 }
117 117
118 /// <summary> 118 /// <summary>
@@ -329,7 +329,7 @@ namespace OpenSim.Framework.Capabilities
329 329
330 reader.Read(); 330 reader.Read();
331 FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); 331 FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces);
332 byte[] inp = Encoding.UTF8.GetBytes(reader.ReadString()); 332 byte[] inp = Util.UTF8.GetBytes(reader.ReadString());
333 ret = b64.TransformFinalBlock(inp, 0, inp.Length); 333 ret = b64.TransformFinalBlock(inp, 0, inp.Length);
334 break; 334 break;
335 } 335 }
diff --git a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
index df48b35..7aaa994 100644
--- a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
+++ b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Capabilities
47 public override byte[] Handle(string path, Stream request, 47 public override byte[] Handle(string path, Stream request,
48 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 48 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
49 { 49 {
50 //Encoding encoding = Encoding.UTF8; 50 //Encoding encoding = Util.UTF8;
51 //StreamReader streamReader = new StreamReader(request, false); 51 //StreamReader streamReader = new StreamReader(request, false);
52 52
53 //string requestBody = streamReader.ReadToEnd(); 53 //string requestBody = streamReader.ReadToEnd();
diff --git a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
index b52eda7..415d808 100644
--- a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
+++ b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications.XMPP
38 { 38 {
39 } 39 }
40 40
41 public XMPPWriter(IOStream stream) : this(stream, Encoding.UTF8) 41 public XMPPWriter(IOStream stream) : this(stream, Util.UTF8)
42 { 42 {
43 } 43 }
44 44
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
index 318d2c3..3dce578 100644
--- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
+++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Framework.Configuration.HTTP
77 count = resStream.Read(buf, 0, buf.Length); 77 count = resStream.Read(buf, 0, buf.Length);
78 if (count != 0) 78 if (count != 0)
79 { 79 {
80 tempString = Encoding.UTF8.GetString(buf, 0, count); 80 tempString = Util.UTF8.GetString(buf, 0, count);
81 sb.Append(tempString); 81 sb.Append(tempString);
82 } 82 }
83 } while (count > 0); 83 } while (count > 0);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 771ae05..f314d64 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -965,7 +965,7 @@ namespace OpenSim.Framework.Servers.HttpServer
965 } 965 }
966 966
967 // response.ContentType = "application/llsd+json"; 967 // response.ContentType = "application/llsd+json";
968 // return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); 968 // return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
969 response.ContentType = "application/llsd+xml"; 969 response.ContentType = "application/llsd+xml";
970 return OSDParser.SerializeLLSDXmlBytes(llsdResponse); 970 return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
971 } 971 }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 58344f3..59159a8 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -69,7 +69,9 @@ namespace OpenSim.Framework
69 69
70 public static readonly Regex UUIDPattern 70 public static readonly Regex UUIDPattern
71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); 71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
72 72
73 public static Encoding UTF8 = Encoding.UTF8;
74
73 /// <value> 75 /// <value>
74 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) 76 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards)
75 /// </value> 77 /// </value>
@@ -432,7 +434,7 @@ namespace OpenSim.Framework
432 output.Append(": "); 434 output.Append(": ");
433 } 435 }
434 436
435 output.Append(CleanString(Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1))); 437 output.Append(CleanString(Util.UTF8.GetString(bytes, 0, bytes.Length - 1)));
436 } 438 }
437 else 439 else
438 { 440 {
@@ -793,7 +795,7 @@ namespace OpenSim.Framework
793 795
794 public static string Compress(string text) 796 public static string Compress(string text)
795 { 797 {
796 byte[] buffer = Encoding.UTF8.GetBytes(text); 798 byte[] buffer = Util.UTF8.GetBytes(text);
797 MemoryStream memory = new MemoryStream(); 799 MemoryStream memory = new MemoryStream();
798 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true)) 800 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true))
799 { 801 {
@@ -827,7 +829,7 @@ namespace OpenSim.Framework
827 decompressor.Read(buffer, 0, buffer.Length); 829 decompressor.Read(buffer, 0, buffer.Length);
828 } 830 }
829 831
830 return Encoding.UTF8.GetString(buffer); 832 return Util.UTF8.GetString(buffer);
831 } 833 }
832 } 834 }
833 835
@@ -1099,7 +1101,7 @@ namespace OpenSim.Framework
1099 { 1101 {
1100 byte[] data = new byte[length]; 1102 byte[] data = new byte[length];
1101 stream.Read(data, 0, length); 1103 stream.Read(data, 0, length);
1102 string strdata = Encoding.UTF8.GetString(data); 1104 string strdata = Util.UTF8.GetString(data);
1103 OSDMap args = null; 1105 OSDMap args = null;
1104 OSD buffer; 1106 OSD buffer;
1105 buffer = OSDParser.DeserializeJson(strdata); 1107 buffer = OSDParser.DeserializeJson(strdata);