change NeighbourHandlers whatever they are...

This commit is contained in:
UbitUmarov
2020-04-26 19:13:35 +01:00
parent 05f098be56
commit c07f4f3c41
5 changed files with 110 additions and 141 deletions

View File

@@ -26,11 +26,13 @@
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework.Servers.HttpServer;
using log4net;
@@ -99,5 +101,28 @@ namespace OpenSim.Server.Handlers.Simulation
}
}
public static OSDMap DeserializeOSMap(IOSHttpRequest httpRequest)
{
Stream inputStream = httpRequest.InputStream;
Stream innerStream = null;
try
{
if ((httpRequest.ContentType == "application/x-gzip" || httpRequest.Headers["Content-Encoding"] == "gzip") || (httpRequest.Headers["X-Content-Encoding"] == "gzip"))
{
innerStream = inputStream;
inputStream = new GZipStream(innerStream, CompressionMode.Decompress);
}
return (OSDMap)OSDParser.DeserializeJson(inputStream);
}
catch
{
return null;
}
finally
{
if (innerStream != null)
innerStream.Dispose();
}
}
}
}