* Thanks to Mic Bowman for inspiring me to look at that we are still using ASCIIEncoder in places we shouldn't.
parent
239228abd8
commit
76d8eaa406
|
@ -417,7 +417,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
SHA512Managed HashProvider = new SHA512Managed();
|
||||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
|
|
|
@ -366,7 +366,7 @@ namespace OpenSim.Data.MySQL
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
SHA512Managed HashProvider = new SHA512Managed();
|
||||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
|
|
|
@ -224,7 +224,7 @@ namespace OpenSim.Data.SQLite
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
SHA512Managed HashProvider = new SHA512Managed();
|
||||||
ASCIIEncoding TextProvider = new ASCIIEncoding();
|
Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
|
|
|
@ -1223,22 +1223,6 @@ namespace OpenSim.Data.SQLite
|
||||||
s.TextureEntry = textureEntry;
|
s.TextureEntry = textureEntry;
|
||||||
|
|
||||||
s.ExtraParams = (byte[]) row["ExtraParams"];
|
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;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
// 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
|
// an unconnected socket exception is thrown when we close the response output stream. There's no
|
||||||
|
|
|
@ -515,7 +515,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace);
|
m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace);
|
||||||
}
|
}
|
||||||
// This is not quite working, so...
|
// 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);
|
m_log.Info("[DATASNAPSHOT] data service notified: " + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -583,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
return objectname;
|
return objectname;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityBase SensedObject = null;
|
EntityBase SensedObject;
|
||||||
lock (World.Entities)
|
lock (World.Entities)
|
||||||
{
|
{
|
||||||
World.Entities.TryGetValue(objecUUID, out SensedObject);
|
World.Entities.TryGetValue(objecUUID, out SensedObject);
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
if (myIQS.QueueSize == 0)
|
if (myIQS.QueueSize == 0)
|
||||||
return;
|
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);
|
Debug.WriteLine("RAW: " + receivedData);
|
||||||
|
|
||||||
byte newLine = 10;
|
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 += "," + p[i].GetType().ToString() + "|" + HttpUtility.UrlEncode(p[i].ToString()); // .Replace(",", "%44")
|
||||||
}
|
}
|
||||||
tmpStr += "\n";
|
tmpStr += "\n";
|
||||||
byte[] byteData = Encoding.ASCII.GetBytes(tmpStr);
|
byte[] byteData = Encoding.UTF8.GetBytes(tmpStr);
|
||||||
TCPS.Send(ID, byteData, 0, byteData.Length);
|
TCPS.Send(ID, byteData, 0, byteData.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,10 +289,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
||||||
|
|
||||||
//}
|
//}
|
||||||
// READ EVENT CODE CHUNKS
|
// READ EVENT CODE CHUNKS
|
||||||
LSO_Struct.CodeChunk[] myEventCodeChunk;
|
|
||||||
if (myStateFrameBlock.StateCount > 0)
|
if (myStateFrameBlock.StateCount > 0)
|
||||||
{
|
{
|
||||||
myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount];
|
|
||||||
for (int i = 0; i < myStateFrameBlock.StateCount; i++)
|
for (int i = 0; i < myStateFrameBlock.StateCount; i++)
|
||||||
{
|
{
|
||||||
// TODO: Somehow organize events and functions so they can be found again,
|
// 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?
|
// TODO: How to determine number of codechunks -- does this method work?
|
||||||
myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
|
myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>();
|
||||||
byte reader = br_read(1)[0];
|
byte reader = br_read(1)[0];
|
||||||
reader = br_read(1)[0];
|
|
||||||
|
|
||||||
// NOTE ON CODE CHUNK ARGUMENTS
|
// NOTE ON CODE CHUNK ARGUMENTS
|
||||||
// This determins type definition
|
// This determins type definition
|
||||||
|
|
|
@ -656,21 +656,6 @@ namespace OpenSim.DataStore.MSSQL
|
||||||
|
|
||||||
|
|
||||||
s.ExtraParams = (byte[]) row["ExtraParams"];
|
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;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ namespace OpenSim.TestSuite
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
break;
|
break;
|
||||||
case "addbots":
|
case "addbots":
|
||||||
int newbots = 0;
|
int newbots;
|
||||||
Helpers.TryParse(cmdparams[0], out newbots);
|
Helpers.TryParse(cmdparams[0], out newbots);
|
||||||
|
|
||||||
if (newbots > 0)
|
if (newbots > 0)
|
||||||
|
|
|
@ -196,7 +196,7 @@ namespace pCampBot
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
break;
|
break;
|
||||||
case "addbots":
|
case "addbots":
|
||||||
int newbots = 0;
|
int newbots;
|
||||||
Helpers.TryParse(cmdparams[0], out newbots);
|
Helpers.TryParse(cmdparams[0], out newbots);
|
||||||
|
|
||||||
if (newbots > 0)
|
if (newbots > 0)
|
||||||
|
|
|
@ -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)
|
public static void Send(Socket client, byte[] byteData)
|
||||||
{
|
{
|
||||||
client.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), client);
|
client.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), client);
|
||||||
|
|
Loading…
Reference in New Issue