* Thanks to Mic Bowman for inspiring me to look at that we are still using ASCIIEncoder in places we shouldn't.

0.6.0-stable
Adam Frisby 2008-05-01 18:50:44 +00:00
parent 239228abd8
commit 76d8eaa406
13 changed files with 10 additions and 76 deletions

View File

@ -417,7 +417,7 @@ namespace OpenSim.Data.MSSQL
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
{
SHA512Managed HashProvider = new SHA512Managed();
ASCIIEncoding TextProvider = new ASCIIEncoding();
Encoding TextProvider = new UTF8Encoding();
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);

View File

@ -366,7 +366,7 @@ namespace OpenSim.Data.MySQL
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
{
SHA512Managed HashProvider = new SHA512Managed();
ASCIIEncoding TextProvider = new ASCIIEncoding();
Encoding TextProvider = new UTF8Encoding();
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);

View File

@ -224,7 +224,7 @@ namespace OpenSim.Data.SQLite
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
{
SHA512Managed HashProvider = new SHA512Managed();
ASCIIEncoding TextProvider = new ASCIIEncoding();
Encoding TextProvider = new UTF8Encoding();
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);

View File

@ -1223,22 +1223,6 @@ namespace OpenSim.Data.SQLite
s.TextureEntry = textureEntry;
s.ExtraParams = (byte[]) row["ExtraParams"];
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
// string texture = encoding.GetString((Byte[])row["Texture"]);
// if (!texture.StartsWith("<"))
// {
// //here so that we can still work with old format database files (ie from before I added xml serialization)
// LLObject.TextureEntry textureEntry = null;
// textureEntry = new LLObject.TextureEntry(new LLUUID(texture));
// s.TextureEntry = textureEntry.ToBytes();
// }
// else
// {
// TextureBlock textureEntry = TextureBlock.FromXmlString(texture);
// s.TextureEntry = textureEntry.TextureData;
// s.ExtraParams = textureEntry.ExtraParams;
// }
return s;
}

View File

@ -201,7 +201,7 @@ namespace OpenSim.Framework.Servers
}
}
}
catch (SocketException e)
catch (SocketException)
{
// At least on linux, it appears that if the client makes a request without requiring the response,
// an unconnected socket exception is thrown when we close the response output stream. There's no

View File

@ -515,7 +515,7 @@ namespace OpenSim.Region.DataSnapshot
m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace);
}
// This is not quite working, so...
string responseStr = ASCIIEncoding.UTF8.GetString(response);
string responseStr = Encoding.UTF8.GetString(response);
m_log.Info("[DATASNAPSHOT] data service notified: " + url);
}

View File

@ -583,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.Common
return objectname;
}
EntityBase SensedObject = null;
EntityBase SensedObject;
lock (World.Entities)
{
World.Entities.TryGetValue(objecUUID, out SensedObject);

View File

@ -119,7 +119,7 @@ namespace OpenSim.Region.ScriptEngine.Common
if (myIQS.QueueSize == 0)
return;
string receivedData = Encoding.ASCII.GetString(myIQS.Queue, 0, myIQS.QueueSize);
string receivedData = Encoding.UTF8.GetString(myIQS.Queue, 0, myIQS.QueueSize);
Debug.WriteLine("RAW: " + receivedData);
byte newLine = 10;
@ -197,7 +197,7 @@ namespace OpenSim.Region.ScriptEngine.Common
tmpStr += "," + p[i].GetType().ToString() + "|" + HttpUtility.UrlEncode(p[i].ToString()); // .Replace(",", "%44")
}
tmpStr += "\n";
byte[] byteData = Encoding.ASCII.GetBytes(tmpStr);
byte[] byteData = Encoding.UTF8.GetBytes(tmpStr);
TCPS.Send(ID, byteData, 0, byteData.Length);
}
}

View File

@ -289,10 +289,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//}
// READ EVENT CODE CHUNKS
LSO_Struct.CodeChunk[] myEventCodeChunk;
if (myStateFrameBlock.StateCount > 0)
{
myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount];
for (int i = 0; i < myStateFrameBlock.StateCount; i++)
{
// TODO: Somehow organize events and functions so they can be found again,
@ -465,7 +463,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// TODO: How to determine number of codechunks -- does this method work?
myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
byte reader = br_read(1)[0];
reader = br_read(1)[0];
// NOTE ON CODE CHUNK ARGUMENTS
// This determins type definition

View File

@ -656,21 +656,6 @@ namespace OpenSim.DataStore.MSSQL
s.ExtraParams = (byte[]) row["ExtraParams"];
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
// string texture = encoding.GetString((Byte[])row["Texture"]);
// if (!texture.StartsWith("<"))
// {
// //here so that we can still work with old format database files (ie from before I added xml serialization)
// LLObject.TextureEntry textureEntry = null;
// textureEntry = new LLObject.TextureEntry(new LLUUID(texture));
// s.TextureEntry = textureEntry.ToBytes();
// }
// else
// {
// TextureBlock textureEntry = TextureBlock.FromXmlString(texture);
// s.TextureEntry = textureEntry.TextureData;
// s.ExtraParams = textureEntry.ExtraParams;
// }
return s;
}

View File

@ -197,7 +197,7 @@ namespace OpenSim.TestSuite
Environment.Exit(0);
break;
case "addbots":
int newbots = 0;
int newbots;
Helpers.TryParse(cmdparams[0], out newbots);
if (newbots > 0)

View File

@ -196,7 +196,7 @@ namespace pCampBot
Environment.Exit(0);
break;
case "addbots":
int newbots = 0;
int newbots;
Helpers.TryParse(cmdparams[0], out newbots);
if (newbots > 0)

View File

@ -80,38 +80,6 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
}
}
/*
public static void Receive(Socket client) {
try {
StateObject state = new StateObject();
state.workSocket = client;
client.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state);
} catch (Exception e) {
Console.WriteLine(e.ToString());
}
}
private static void ReceiveCallback( IAsyncResult ar ) {
try {
StateObject state = (StateObject) ar.AsyncState;
Socket client = state.workSocket;
int bytesRead = client.EndReceive(ar);
if (bytesRead > 0) {
state.sb.Append(Encoding.ASCII.GetString(state.buffer,0,bytesRead));
client.BeginReceive(state.buffer,0,StateObject.BufferSize,0, new AsyncCallback(ReceiveCallback), state);
} else {
if (state.sb.Length > 1) {
response = state.sb.ToString();
}
receiveDone.Set();
}
} catch (Exception e) {
Console.WriteLine(e.ToString());
}
}
*/
public static void Send(Socket client, byte[] byteData)
{
client.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), client);